Fejl i upload script
Jeg får en fejl når jeg vil køre den her kode:aspSmartUpload error '800a0009'
Subscript out of range
/fil_upload.asp, line 49
<!-- #Include file="dbconn.asp" -->
<%
' Variables
' *********
Dim mySmartUpload
Dim file
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
' Only allow txt or htm files
' ***************************
' 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 = 3000000
' Deny upload if the total fila size is greater than 200000 bytes
' ***************************************************************
mySmartUpload.TotalMaxFileSize = 3000000
' Upload
' ******
Title = mySmartUpload.form("title")
strQuery_add = "INSERT INTO jb_items (cat, title, text, data, extra) VALUES ('" & mySmartUpload.form("cat") & "', '" & Title & "', '" & mySmartUpload.form("text") & "', '" & mySmartUpload.form("data") & "', '" & mySmartUpload.form("extra") & "')"
Set objRS_add = conn.Execute(strQuery_add)
Set Rs = Conn.Execute("SELECT * FROM jb_items WHERE title = '"&Title&"'")
ID = rs("id")
if NOT fso.FolderExists(Server.Mappath("/img/items/"&ID)) then
fso.CreateFolder(Server.Mappath("/img/items/"&ID))
end if
mySmartUpload.Upload <--------Linie 49!!!!
PicCount = 0
For each file In mySmartUpload.Files
If not file.IsMissing Then
file.SaveAs("/img/items/"& ID &"/"&file.FileName)
PicCount = PicCount + 1
End If
Next
strQuery_Update = "UPDATE jb_items SET piccount = '" & PicCount & "' WHERE id = "&id
conn.Execute(strQuery_Update)
response.redirect "?Side=nyt_produkt"
%>
