aspUpload: what am I doing wrong?

J

John

I can get this to upload files but I can't get items out of the Files
collection into the database. I'm getting this error

Microsoft VBScript runtime error '800a005b'

Object variable not set

/admin/media_upload_recording_process.asp, line 94


I don't entirely understand use this. I've gone over their website manual
and I don't really grasp how to do this. Can anyone help?

Thanks!

<%
Set Upload = Server.CreateObject("Persits.Upload.1")
' Upload files
Upload.SetMaxSize 1048576 ' Truncate files above 1MB
Upload.Save "e:\InetPub\Clients\thehalftonhorns.com\media\"

If Err <> 0 Then
Response.write _
"<span class='smallRed'>The following error occured while
uploading</span><br>" & _
"<span class='smallWhite'>" & Err.Description & "</span>" & _
"<span class='smallGray'>To try again<A
HREF='/media_upload_recordings.asp'>click here</A>.</span>"
Else
'show upload results
Response.write _
"<table width='100%' bordercolor='#808080' border='1' cellpadding='0'
cellspacing='0'>" & _
"<th align='left' class='smallGray'>Uploaded File</th><th align='left'
class='smallGray'>Size</th><th align='left' class='smallGray'>Original
Size</th>" & _
"<tr>"
For Each File in Upload.Files
If File.ImageType = "GIF" or File.ImageType = "JPG" or File.ImageType =
"PNG" Then
Response.write _
"<td align=center valign='bottom'>" & _
"<img src='/media/" & File.FileName & "'><BR>" & _
File.OriginalPath & "<BR>" & _
"(" & File.ImageWidth & " x " & File.ImageHeight & " pixels)" & _
"</td>"
Else
Response.write _
"<td class='smallWhite'>" & File.FileName & "</td>"
End If
Response.write _
"<td class='smallWhite' align='right' valign='top'>" & File.Size &
"bytes</td>" & _
"<td class='smallWhite' align='right' valign='top'>" & File.OriginalSize
& "bytes</td>" & _
"</tr>"
Next
Response.write "</table>"

Set setlistConn = Server.CreateObject("ADODB.Connection")
setlistConn = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source= e:\xxxxx\cgi-bin\recordings.mdb"

Dim objCommand
Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = setlistConn
objCommand.CommandText = "INSERT INTO
tblRecordings(recordingTitle,recordingFileName,recordingFileSize,recordingFi
leDate) VALUES('" & Upload.Form("title") & "','" &
Uploaded.File("File.FileName") & "," & Upload.Files("File.FileSize") & "," &
now & "');"
objCommand.CommandType = adCmdText
objCommand.Execute
Set objCommand = Nothing
 
J

Jason Brown [MSFT]

Which line is line 94?


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no
rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top