Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Renaming with Fileup

Status
Not open for further replies.

emissions

Technical User
Mar 17, 2002
68
0
0
GB
I wonder if anyone can help???

I currently developing a small application that allows a user to select a number of files (jpg) and upload them to the server.

I want the files uploaded to automatically renamed, say something like - gallery01_01.jpg and the next file being gallery01_02.jpg but the name i.e. gallery01 must be taken from a form input, that the user inputs.

I'm using saFileup as the controller... can this be done ???

<%
if Request.QueryString("uploader") = "true" then
Set upl = Server.CreateObject("SoftArtisans.FileUp")
basePath = Server.MapPath("\bambuddha\")
upl.Path = basePath & "\upload\gallery"
upl.CreateNewFile = true
strFileName = Mid(upl.UserFilename, InstrRev(upl.UserFilename, "\") + 1)
folder = upl.form("directory")

For Each strFormElement In upl.Form

If IsObject(upl.Form(strFormElement)) Then
If Not upl.Form(strFormElement).IsEmpty Then
upl.Form(strFormElement).Save
End If
End If
Next

End If
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top