AspSmartUpload (Error 1205)
HJÆLP!!!Jeg får følgende fejlmeddelelse når jeg forsøger at uploade et billede: "Wrong selection : Invalid Files Name '1' (Error 1205)"
Min form ser således ud:
strRediger = strRediger & "<form id='form1' name='form1' method='POST' ENCTYPE='multipart/form-data' action='babesave.asp'>"
strRediger = strRediger & "<INPUT TYPE='Hidden' NAME='User' VALUE='" & varUserName & "'>"
strRediger = strRediger & "<tr><td><input TYPE='FILE' SIZE='40' NAME='FILE1'></center></td></tr>"
strRediger = strRediger & "<tr><td><center><input TYPE='text' SIZE='40' NAME='babename'></center></td></tr></form>"
Og babesave.asp ser således ud:
<%
Response.Buffer = true
Response.CacheControl = "no-cache"
Response.Expires = -1
%>
<!-- #include file="Adovbs.inc" -->
<%
strUser = Request.Form("User")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("datab/Projekt.mdb")
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open "Babes", Conn, adOpenDynamic, adLockOptimistic, adCmdTable
rs.Addnew
rs("BabeName") = Request.Form("babename")
rs("AddedBy") = strUser
rs("DateAdded") = now()
rs("AverageScore") = 0
rs("Votes") = 0
rs.update
rs.Close
set rs = Nothing
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL="SELECT * FROM Babes ORDER BY idBabe DESC"
rs.Open strSQL, Conn, 1
if not rs.eof then
strBabeId = rs("idBabe")
else
strBabeId = 1000
end if
rs.Close
set rs = Nothing
strBabeNumber = strBabeId + 1
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body>
<%
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 = "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 = 300000
' Deny upload if the total fila size is greater than 200000 bytes
' ***************************************************************
' mySmartUpload.TotalMaxFileSize = 200000
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
mySmartUpload.Save("Images/Babes")
mysmartUpload.files.item(1).saveas "Images/Babes/test.jpg"
' Trap errors
' ***********
If Err Then
Response.Write("<b>Wrong selection : </b>" & Err.description)
Else
' Display the number of files uploaded
' ************************************
Response.Redirect("index.asp")
End If
%>
</body>
</html>
Håber der er en derude der kan se hvad fejlen er, for jeg kan ikke!