webForumDet fria alternativet

ASPsmartUpload

ASPur ASP

1 svar · 277 visningar · startad av Silve

SilveMedlem sedan aug. 200214 inlägg
#1

Hej!

Har ett script i ASPsmartupload...
en bild laddas upp helt felfritt...
men nu vill jag ha med filnamnet på filen i en session som skall heta "filnamn"....har försökt på hur många sätt som helst men blir inte klokare av något...

kan det vara något med:
Session("namnet på sessionen") = file.FileName
men vart isf skall den ligga?
Object Required blir errormesset om jag lägger in den raden...

<%
On Error Resume Next

' Variables
' *********
Dim mySmartUpload
Dim intCount

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Only allow txt or htm files
' ***************************
mySmartUpload.AllowedFilesList = "gif,jpg,jpeg"

' DeniedFilesList can also be used :
' Allow all files except exe, bat and asp
' ***************************************
' mySmartUpload.DeniedFilesList = "exe,bat,asp"

' Deny physical path
' *******************
mySmartUpload.DenyPhysicalPath = True

' Only allow files smaller than 50000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 500000000

' Deny upload if the total fila size is greater than 200000 bytes
' ***************************************************************
mySmartUpload.TotalMaxFileSize = 200000

' Upload
' ******
mySmartUpload.Upload

intCount = mySmartUpload.Save("../images/rampljuset")
' sample with a physical path
' intCount = mySmartUpload.Save("../images/rampljuset")

' Trap errors
' ***********
If Err Then
Response.Write("Wrong selection : " & Err.description)
Else

Response.Redirect "rampljuset.asp?section=upload2"

End If

%>

Jesper TMedlem sedan nov. 20017 144 inlägg
#2

Testa att lägga den här(fetmarkering).
Var vänlig och använd [ kod]-taggar.

<%
On Error Resume Next

' Variables
' *********
Dim mySmartUpload
Dim intCount

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Only allow txt or htm files
' ***************************
mySmartUpload.AllowedFilesList = "gif,jpg,jpeg"

' DeniedFilesList can also be used :
' Allow all files except exe, bat and asp
' ***************************************
' mySmartUpload.DeniedFilesList = "exe,bat,asp"

' Deny physical path
' *******************
mySmartUpload.DenyPhysicalPath = True

' Only allow files smaller than 50000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 500000000

' Deny upload if the total fila size is greater than 200000 bytes
' ************************************************************
***
mySmartUpload.TotalMaxFileSize = 200000

' Upload
' ******
mySmartUpload.Upload

intCount = mySmartUpload.Save("../images/rampljuset")
' sample with a physical path 
' intCount = mySmartUpload.Save("../images/rampljuset")

[b]Session("namnet på sessionen") = mySmartUpload.Files.Item(1).FileName[/b]

' Trap errors
' ***********
If Err Then
Response.Write("Wrong selection : " & Err.description)
Else

Response.Redirect "rampljuset.asp?section=upload2"

End If

%>

/red

134 ms totalt · 3 externa anrop · v20260731065814-full.b2af184d
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)