Citat:
Originally posted by rille77@Apr 2 2004, 00:30
Har problem när jag vill byta namn på filen jag laddar upp.
Så här ser min kod ut.
' Variables
' *********
Dim mySmartUpload
Dim FileType
Dim Image
FileType = Right(Request.Form("file"),3)
Image = Request.Querystring("id") & "." & FileType
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ************************************************** **************************
'intCount = mySmartUpload.Save("/images/drinkar")
' sample with a physical path
mySmartUpload.SaveAs("D:/kunder/sponsrat/krogliv.com/crop/images/" & Image & "")
response.redirect "crop.asp?image=drink" & Image & ""
|
Så här gjorde jag:
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' *********
mySmartUpload.Upload
namn = mySmartUpload.Form("code_no")
ext = mySmartUpload.Files.Item(1).FileExt
' ************************************************** **************************
mySmartUpload.files.item(1).saveas "/shop/images/" & namn & "."&ext
bild = namn & "." & ext