CodeCharge Studio

FileFolder Run-Time Property (ASP)

Applies to

FileUpload Control

Type

string

Access

read/write

Syntax

object.FileFolder [=value]

Description

Specifies a folder on the web server where uploaded files will be eventually stored. The initial value of this property comes from the "File Folder" design-time property of the FileUpload component.

This property may be used to specify different target folders for keeping different file types or to sort uploads in different folders for different users. The property should be set in Before Process File event.

Note: The property's value is set only if the pointed folder exists. Absolute filesystem paths should be used to avoid context ambiguities. Server.MapPath method can be used to determine the absolute folder path.

Examples

The following example checks if the uploaded file extension is JPG. If so, the file will be saved into images subdirectory. Otherwise, the file will saved into uploads subdirectory.
The code assumes Form1 form exists and it contains FileUpload1 control. This code can be inserted into control's Before Process File event.
If UCase(Right(Form1.FileUpload1.Value, 4)) = ".JPG" Then
  Form1.FileUpload1.FileFolder = Server.MapPath("./images/")
Else
  Form1.FileUpload1.FileFolder = Server.MapPath("./uploads/")
End If

See also

TemporaryFolder property
Value property
Before Process File event


On-line, printable versions and updates