Gets the qualified name of the file on the client.

Namespace:  EasyAlgo.EAUpload
Assembly:  EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.0.0

Syntax

C#
public string QualifiedFileName { get; }
Visual Basic (Declaration)
Public ReadOnly Property QualifiedFileName As String

Field Value

Type: System..::.String
A string consisting of the characters after the last directory character in uploaded file path on the client's machine.

Remarks

Returns a string without the characters that are not allowed in path and file names. For example, on Windows-based desktop platforms, invalid path characters might include ASCII/Unicode characters 1 through 31, as well as quote ("), less than (<), greater than (>), pipe (|), backspace (\b), null (\0) and tab (\t).

In general you should only use the QualifiedFileName for saving the file when the original name is essential to the upload. In other cases you should assign a new name to your file to allow you to maintain control over the names of files saved on your server.

Examples

The following code example demonstrates how to save an uploaded file to the specific location. This code example is part of a larger example provided for the UploadedFile class.
CopyC#
// UploadFile.aspx.cs

...

    Upload _upload = UploadsManager.GetUpload();

    // Define directory to which an uploaded files will be stored.
    string SaveFolder = Server.MapPath("") + "\\UploadedFiles\\";

    if (_upload != null && _upload.Status.State == UploadState.Complete)
    {
        // Iterate through uploaded files collection.
        for (int i = 0; i < _upload.UploadedFiles.Count; i++)
        {
            UploadedFile _file = _upload.UploadedFiles[i];

            // Save an uploaded file to a specific location 
            // with name that was been on the client's machine.
            // You can save an uploaded file with any name.
            // To do that, just specify the required name in "path" parameter of SaveAs method.
            _file.SaveAs(SaveFolder + _file.QualifiedFileName, true);
        }
    }    
...
CopyVB.NET
' UploadFile.aspx.vb


...

    Dim _upload As Upload = UploadsManager.GetUpload

    ' Define directory to which an uploaded files will be stored.
    Dim SaveFolder As String = Server.MapPath("") & "\UploadedFiles\"

    If ((Not _upload Is Nothing) AndAlso (_upload.Status.State = UploadState.Complete)) Then
        Dim i As Integer

        ' Iterate through uploaded files collection.
        For i = 0 To _upload.UploadedFiles.Count - 1
            Dim _file As UploadedFile = _upload.UploadedFiles.Item(i)

            ' Save an uploaded file to a specific location 
            ' with name that was been on the client's machine.
            ' You can save an uploaded file with any name.
            ' To do that, just specify the required name in "path" parameter of SaveAs method.                    
            _file.SaveAs(SaveFolder & _file.QualifiedFileName, True)
        Next i
    End If
...

See Also