-
Super Upload
I would like to upload a file with Super Upload but then when it writes it, rename it. If I am uploading logo.gif, I would like it to save 1_logo.gif. How do I change the file name to be written?
-
Hi,
If you have a file on your server that you want to rename, you can use the standard ASP FileSystemObject. Check the ASP documentation for the MoveFile option. The user will need to have modify permission in the directory for this to be successful by the way. Here's a snippet of code:
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile Server.MapPath("/subdir/Red.asp"), _
Server.MapPath("/subdir/Blue.asp")
Set objFSO = Nothing
Take care,
John
-
Missunderstood
I want to use superupload. I want to upload red.jpg, but when it writes to the server, it writes 1_red.jpg. I want to rename the file as superupload writes it.
Dan
-
Dan,
The On-Line DOC has this to say:
Syntax:
aBoolean = object.Save
aBoolean = object.Save( aPath, aFileName)
This method saves an uploaded file to the web server's hard disk. Both aPath and aFileName are optional parameters. If aPath is not specified the file is saved to the directory defined by the previously assigned Path property (see SuperUpload object, property Path). If aFileName not specified the client’s original filename is used.
The method returns True if the file was saved successfully
I hope that helps,
Mark
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|