File upload med ASP SMART UPLOAD
Hej,Jeg kan ikke få det her script til at virke jeg bruger ASP SMART UPLOAD. Jeg tror det er noget med min database jeg bruger MYSQL hvad type skal feldet være for man kan uploade filer til det ?
<%
' Variables
' *********
Dim mySmartUpload
Dim file
Dim oConn
Dim oRs
Dim intCount
intCount=0
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Connect to the DB
' *****************
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "driver=MySQL ODBC 3.51 Driver;server=localhost;port=3306;Database=file_upload;uid=root;pwd="
' Open a recordset
' ****************
strSQL = "SELECT FILENAME,FILE FROM aspsmartupload"
Set oRs = Server.CreateObject("ADODB.recordset")
Set oRs.ActiveConnection = oConn
oRs.Source = strSQL
oRs.LockType = 3
oRs.Open
' Select each file
' ****************
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If not file.IsMissing Then
' Add the current file in a DB field
' **********************************
oRs.AddNew
file.FileToField oRs.Fields("FILE")
oRs("FILENAME") = file.FileName
oRs.Update
intCount = intCount + 1
End If
Next
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.<BR>")
' Destruction
' ***********
oRs.Close
oConn.Close
Set oRs = Nothing
Set oConn = Nothing
%>
og jeg får denne fejl
Technical Information (for support personnel)
Error Type:
ADODB.Field (0x800A0C93)
Operation is not allowed in this context.
/scripts/aspSmartUpload/Sample4.asp, line 50
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Page:
POST 56778 bytes to /scripts/aspSmartUpload/Sample4.asp
POST Data:
error '80020009'
Exception occurred.
/iisHelp/common/500-100.asp, line 223
