Skip to main content
A newer version of this page is available. .
Tab

ASPxUploadControl.FileName Property

OBSOLETE

Use the UploadedFiles[].FilesName property

Gets the uploaded file’s name.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[Obsolete("Use the UploadedFiles[].FilesName property")]
public string FileName { get; }

Property Value

Type Description
String

A String value specifying the file name.

Remarks

You can use this property’s value to compose the UploadedFile.SaveAs method’s parameter value.

The FileName property contains the name of the uploaded file, but does not store the path to the file.

Example

<script type="text/javascript">
     function onFileUploadStart(s, e) {
          DXUploadedFilesContainer.Clear();
     }
     function onFileUploadComplete(s, e) {
          if(e.callbackData) {
               var fileData = e.callbackData.split('|');
               var fileName = fileData[0],
                    fileUrl = fileData[1],
                    fileSize = fileData[2];
               DXUploadedFilesContainer.AddFile(fileName, fileUrl, fileSize);
          }
     }
</script>
    ...
<dx:ASPxUploadControl ID="UploadControl" runat="server" ClientInstanceName="UploadControl" Width="100%"
     NullText="Select multiple files..." UploadMode="Advanced" ShowUploadButton="True" ShowProgressPanel="True"
     OnFileUploadComplete="UploadControl_FileUploadComplete">
     <AdvancedModeSettings EnableMultiSelect="True" EnableFileList="True" EnableDragAndDrop="True" />
     <ValidationSettings MaxFileSize="4194304" AllowedFileExtensions=".jpg,.jpeg,.gif,.png">
     </ValidationSettings>
     <ClientSideEvents FilesUploadStart="onFileUploadStart" FileUploadComplete="onFileUploadComplete" />
</dx:ASPxUploadControl>

<dx:UploadedFilesContainer ID="FileContainer" runat="server" Width="100%" Height="180" 
     NameColumnWidth="240" SizeColumnWidth="70" HeaderText="Uploaded files" />
See Also