473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

aspUpload: what am I doing wrong?

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,rec ordingFileSize,recordingFi
leDate) VALUES('" & Upload.Form("title") & "','" &
Uploaded.File("File.FileName") & "," & Upload.Files("File.FileSize") & "," &
now & "');"
objCommand.CommandType = adCmdText
objCommand.Execute
Set objCommand = Nothing

Jul 22 '05 #1
1 2203
Which line is line 94?
--
Jason Brown
Microsoft GTSC, IIS

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

"John" <no***@amIgivingitouthere.com> wrote in message
news:3P****************@twister.nyroc.rr.com...
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,rec ordingFileSize,recordingFi
leDate) VALUES('" & Upload.Form("title") & "','" &
Uploaded.File("File.FileName") & "," & Upload.Files("File.FileSize") & ","
&
now & "');"
objCommand.CommandType = adCmdText
objCommand.Execute
Set objCommand = Nothing

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Rebbeck | last post by:
(sorry about cross posting but I really need help with this and it fits in both newsgroups) I'm creating a little image manager and I'm using Persits ASPUpload. I have an UploadButton and...
2
by: | last post by:
I am using aspupload in a hosting environment. When testing the basic install of the component I am trying to use the default forms provided. When using the the first method as found at...
1
by: | last post by:
I am using ASPUpload and trying to upload images to a database. I have had success in getting the image to the db and then dispalying the imnage on a webpage. The problem is wheni have more than one...
1
by: Nakedwalls | last post by:
Hi everyone, I've not really had much experience of ASPUpload yet, so some help would be much appreciated!. What I'm trying to do is upload an image (which I've managed with the sample code...
6
by: Vilmar Brazão de Oliveira | last post by:
HI; How can I rename a file with aspupload or FSO before upload? I looked for in documentation of these products, but I could not find anything yet! Thanks, -- ««««««««»»»»»»»»»»»»»»
2
by: Vilmar Brazão de Oliveira | last post by:
Hi, How verify type or extension of file using ASPUPLOAD? I check documentation, but I didn't find anything else yet. thanks, -- ««««««««»»»»»»»»»»»»»» Vlmar Brazão de Oliveira...
5
by: Kelli | last post by:
Hi there, I'm wondering if someone can have a quick look at my code and see if there's anything that I've done wrong. This silly script is driving me crazy! <% DIM File, Upload, Count,...
8
by: BigJohnson | last post by:
We're using ASPUpload as a tool to upload files to our server and save the details to SQLServer. However, I have an application where I need to return the pkID of the just saved file. I'm assuming...
0
by: hellind | last post by:
When the form is submitted as ENCTYPE="multipart/form-data" using AspUpload component, I understand to use Upload.form("") to retreive the form elements. But I cannot retreive it from inside a class....
5
by: the other john | last post by:
I'm not certain that what I'm asking is an AspUpload question or just a VBScript question. I am uploading a story with up to 3 pictures. Each picture uploads using aspupload with no problems. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.