| 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. Use VBScript to extract the file's extension, if necessary. See Example 2, below. 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., upl.Form("FILE1").UserFilename. |
... The file you uploaded was <%=upl.UserFilename%>. ...
<%
Set upl = Server.CreateObject("SoftArtisans.FileUp")
'---
'--- Set the default path to store uploaded files.
'--- This should be set immediately after creating an instance.
'---
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.SaveAs NewFileName
... %>
| Previous Page | Next Page |