UserFilename Property

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

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

To extract the user's original filename from the complete path on the client machine, if necessary, use VBScript as in Example 2, below.  Or (with version 3.3.2 and above of FileUp) use the ShortFilename property.

The complete name of the file depends on 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.

UNIX users will send files in driveletter:\dir1\\file.ext format.

If there is more than one file being uploaded in a single page, only the first one is displayed.

To examine the UserFilename of multiple files in a single upload, there is an equivalent property for each file object, i.e., fileUpload.Form("File1").UserFilename. Please see SAFile.UserFileName

Examples:

Output entire client file name (including path) of the first uploaded file:

ASP The file you uploaded was: <%=fileUpload.UserFilename%>.
C# results.Append("The file you uploaded was: " +
fileUpload.UserFilename);
VB.NET results.Append("The file you uploaded was: " + _
fileUpload.UserFilename)

Copyright © 2010 SoftArtisans, Inc. All rights reserved.