CodeCharge Studio

GetOriginFileName Method (ASP)

Applies to

FileUpload Control

Syntax

object.GetOriginFileName

Description

This method retrieves the original file name of an uploaded file (i.e. without the prefix that is added to ensure that the file name is unique).

This function can be used to display the original file name to the user or construct alternative save names.

Examples

The following example constructs an uploaded file download link with a specific label containing original file name and size.
It assumes the form is named Form1 and the upload control is named FileUpload1. DownloadLink is a link control.
If Form1.FileUpload1.IsUploaded Then
  Form1.DownloadLink.Link = Form1.FileUpload1.Value
  Form1.DownloadLink.Value = "download " & Form1.FileUpload1.GetOriginFileName(Form1.FileUpload1.Value) & " [" & Form1.FileUpload1.FileSize & "]"
End If

See also

Value Property
FileFolder Property
Get Original Filename Action


On-line, printable versions and updates