Hi serran,
I suggest you use method "CopyTo" to handle the upload file store location and the new file name. Then you can save it to any folder and use any name you need. The example below shows you how to achieve it.
mvcfile.FileName is the original file name, you can change it directly. Like "abc.jpg".
- <%@ Language="VBScript" %>
- <!-- #include file="aspuploader/include_aspuploader.asp" -->
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>
- example
- </title>
- </head>
- <body>
- <div>
- <form id="form1" method="POST">
- <%
- Dim uploader
- Set uploader=new AspUploader
- uploader.MaxSizeKB=10240
- uploader.Name="myuploader"
- uploader.InsertText="Upload File (Max 10M)"
- uploader.MultipleFilesUpload=true
- %>
- <%=uploader.GetString() %>
- </form>
-
- <br/><br/>
- <%
- If Request.Form("myuploader")&""<>"" Then
-
- Dim list,i
-
-
- list=Split(Request.Form("myuploader"),"/")
-
- For i=0 to Ubound(list)
- Dim mvcfile
-
- Set mvcfile=uploader.GetUploadedFile(list(i))
- mvcfile.CopyTo(Server.MapPath(".")&"/savefiles/"&mvcfile.FileName)
- Next
- End If
-
- %>
-
- </div>
- </body>
- </html>
Regards,
Ken