Cannot call BinaryRead
Hejsa... Jeg får følgende fejl:Request object error 'ASP 0206 : 80004005'
Cannot call BinaryRead
/upload/upload.asp, line 30
Cannot call BinaryRead after using Request.Form collection.
Når jeg kører følgende script! Der er selvfølgelig et eller andet jeg ikke må - noget med noget Request.form, der ikke kan fungerer sammen med det hersens smartupload-ting! Hvordan kan jeg lave det???
<HTML>
<BODY BGCOLOR="white">
<H1>aspSmartUpload : Sample 2</H1>
<HR>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("../db/hovedbasen.mdb")
Conn.Open DSN
strType = Request.form("type")
strForklaring = Request.form("forklaring")
' Variables
' *********
Dim mySmartUpload
Dim file
Dim intCount
intCount=0
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Select each file
' ****************
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If not file.IsMissing Then
' Save the files with his original names in a virtual path of the web server
' **************************************************************************
file.SaveAs("/upload/filer/" & file.FileName)
' sample with a physical path
' file.SaveAs("c:\temp\" & file.FileName)
' Display the properties of the current file
' ******************************************
strFilnavn = file.FileName
strSize = file.Size
strSQL = "Insert into multimedia (filnavn, type, size, forklaring) values('"& strFilnavn &"', '"& strType &"', '"& strSize &"', '"& strForklaring &"')"
Conn.Execute(strSQL)
Conn.Close
Set Conn = Nothing
Response.Write("Name = " & file.Name & "<BR>")
Response.Write("Size = " & file.Size & "<BR>")
Response.Write("FileName = " & file.FileName & "<BR>")
Response.Write("FileExt = " & file.FileExt & "<BR>")
Response.Write("FilePathName = " & file.FilePathName & "<BR>")
Response.Write("ContentType = " & file.ContentType & "<BR>")
Response.Write("ContentDisp = " & file.ContentDisp & "<BR>")
Response.Write("TypeMIME = " & file.TypeMIME & "<BR>")
Response.Write("SubTypeMIME = " & file.SubTypeMIME & "<BR>")
intCount = intCount + 1
End If
Next
' Display the number of files which could be uploaded
' ***************************************************
Response.Write("<BR>" & mySmartUpload.Files.Count & " files could be uploaded.<BR>")
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.<BR>")
Response.write("<a href=upload.html>Tilbage til upload</a>")
%>
</BODY>
</HTML>
