CodeCharge Studio

IsUploaded Run-Time Property (ASP)

Applies to

FileUpload Control

Type

Boolean

Access

read-only

Syntax

object.IsUploaded

Description

This property holds upload control's state. If a file is being processed after submitting the form, or a file has been previously uploaded, this property is set to true. If no file has been uploaded, the property is set to false.

This property may be used to handle different file upload component behavior when it is populated and when it is empty. For instance, the FileUpload component may be hidden if a file has been previously uploaded and the user has no permissions to delete it. In case a file exists, additional information may be extracted from the filesystem to be displayed by another control (modification date for instance).

Examples

The following example retrieves the file's creation date and assigns it to a label if upload control is populated.
This example assumes Form1 record contains FileUpload1 upload control. Label1 control is assigned a value depending on the file's date.
If Form1.FileUpload1.IsUploaded Then
  Dim fso
  Set fso = Server.CreateObject("Scripting.FileSystemObject")
  Form1.Label1.Value = "uploaded on " & fso.getFile(Form1.FileUpload1.FileFolder & Form1.FileUpload1.Value).DateCreated
End If

See also

FileSize property
FileFolder property
Value property
GetOriginFileName method


On-line, printable versions and updates