UserFilename Property

Object: SoftArtisans.SAFile
Syntax: UserFilename
Type: String
Read/Write: Read Only
Description:

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

To extract just the file name, without the path, use the SAFile object's ShortFileName property instead.

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

If you intend to only ever upload one file, you can reduce the amount of code you need to maintain by setting this property on the FileUp object, which will apply the property to the first file in the upload request. See [FileUp].UserFilename.

Examples:
ASP The first file you uploaded was:
<%=fileUpload.form("File1").UserFilename%>
C# results.Append("The first file you uploaded was: " +
((SaFile)fileUpload.Form["File1"]).UserFilename);
VB.NET results.Append("The first file you uploaded was: " + _
CType(fileUpload.Form("File1"), SaFile).UserFilename)

Copyright © 2010 SoftArtisans, Inc. All rights reserved.