Class: SoftArtisans.SAFile

Property: UserFilename

Type: String

Read Only

Description: This property contains the name of the file on the user's hard disk, including path, that was uploaded.

The filename extension can be extracted using VBScript if necessary. See the example below.

The complete name of the file is dependent upon the user's operating system. If user uploads from a Windows PC, the path will be the usual driveletter:\dir1\dir2\file.ext. Several customers have reported that certain browsers on Macintoshes do not report valid pathnames. We have been unable to verify this.

Example :

<%
Set upl = Server.CreateObject("SoftArtisans.FileUp")
'---
'--- Set the default path to store uploaded files.
'--- This should be set immediately after instanciation.
'---
upl.Path = "c:\myuploads"
'---
'--- Save the uploaded file with the same name as the user's file
'--- (assuming the user is Windows-based)
'---
NewFileName = Mid(upl.UserFilename, InstrRev(upl.UserFilename, "\") + 1)
upl.Form("FILE2").SaveAs NewFileName
... %>