473,603 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_re cording_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.CreateOb ject("Persits.U pload.1")
' Upload files
Upload.SetMaxSi ze 1048576 ' Truncate files above 1MB
Upload.Save "e:\InetPub\Cli ents\thehalfton horns.com\media \"

If Err <> 0 Then
Response.write _
"<span class='smallRed '>The following error occured while
uploading</span><br>" & _
"<span class='smallWhi te'>" & Err.Description & "</span>" & _
"<span class='smallGra y'>To try again<A
HREF='/media_upload_re cordings.asp'>c lick here</A>.</span>"
Else
'show upload results
Response.write _
"<table width='100%' bordercolor='#8 08080' border='1' cellpadding='0'
cellspacing='0' >" & _
"<th align='left' class='smallGra y'>Uploaded File</th><th align='left'
class='smallGra y'>Size</th><th align='left' class='smallGra y'>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.OriginalPa th & "<BR>" & _
"(" & File.ImageWidth & " x " & File.ImageHeigh t & " pixels)" & _
"</td>"
Else
Response.write _
"<td class='smallWhi te'>" & File.FileName & "</td>"
End If
Response.write _
"<td class='smallWhi te' align='right' valign='top'>" & File.Size &
"bytes</td>" & _
"<td class='smallWhi te' align='right' valign='top'>" & File.OriginalSi ze
& "bytes</td>" & _
"</tr>"
Next
Response.write "</table>"

Set setlistConn = Server.CreateOb ject("ADODB.Con nection")
setlistConn = "Provider=Micro soft.Jet.OLEDB. 4.0; " & _
"Data Source= e:\xxxxx\cgi-bin\recordings. mdb"

Dim objCommand
Set objCommand = Server.CreateOb ject("ADODB.Com mand")
objCommand.Acti veConnection = setlistConn
objCommand.Comm andText = "INSERT INTO
tblRecordings(r ecordingTitle,r ecordingFileNam e,recordingFile Size,recordingF i
leDate) VALUES('" & Upload.Form("ti tle") & "','" &
Uploaded.File(" File.FileName") & "," & Upload.Files("F ile.FileSize") & "," &
now & "');"
objCommand.Comm andType = adCmdText
objCommand.Exec ute
Set objCommand = Nothing

Jul 22 '05 #1
1 2222
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***@amIgivin gitouthere.com> wrote in message
news:3P******** ********@twiste r.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_re cording_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.CreateOb ject("Persits.U pload.1")
' Upload files
Upload.SetMaxSi ze 1048576 ' Truncate files above 1MB
Upload.Save "e:\InetPub\Cli ents\thehalfton horns.com\media \"

If Err <> 0 Then
Response.write _
"<span class='smallRed '>The following error occured while
uploading</span><br>" & _
"<span class='smallWhi te'>" & Err.Description & "</span>" & _
"<span class='smallGra y'>To try again<A
HREF='/media_upload_re cordings.asp'>c lick here</A>.</span>"
Else
'show upload results
Response.write _
"<table width='100%' bordercolor='#8 08080' border='1' cellpadding='0'
cellspacing='0' >" & _
"<th align='left' class='smallGra y'>Uploaded File</th><th align='left'
class='smallGra y'>Size</th><th align='left' class='smallGra y'>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.OriginalPa th & "<BR>" & _
"(" & File.ImageWidth & " x " & File.ImageHeigh t & " pixels)" & _
"</td>"
Else
Response.write _
"<td class='smallWhi te'>" & File.FileName & "</td>"
End If
Response.write _
"<td class='smallWhi te' align='right' valign='top'>" & File.Size &
"bytes</td>" & _
"<td class='smallWhi te' align='right' valign='top'>" & File.OriginalSi ze
& "bytes</td>" & _
"</tr>"
Next
Response.write "</table>"

Set setlistConn = Server.CreateOb ject("ADODB.Con nection")
setlistConn = "Provider=Micro soft.Jet.OLEDB. 4.0; " & _
"Data Source= e:\xxxxx\cgi-bin\recordings. mdb"

Dim objCommand
Set objCommand = Server.CreateOb ject("ADODB.Com mand")
objCommand.Acti veConnection = setlistConn
objCommand.Comm andText = "INSERT INTO
tblRecordings(r ecordingTitle,r ecordingFileNam e,recordingFile Size,recordingF i
leDate) VALUES('" & Upload.Form("ti tle") & "','" &
Uploaded.File(" File.FileName") & "," & Upload.Files("F ile.FileSize") & ","
&
now & "');"
objCommand.Comm andType = adCmdText
objCommand.Exec ute
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
3270
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 DeleteButton which are both submits. Normally I would do: code:----------------------------------------------------------------------- -------
2
10584
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 http://www.traceydonley.com/aspupload/02_simple/Form2.asp I receive the following error:Persits.Upload.1 error ''800a0028'' This feature has been disabled by system administrator. Use SaveVirtual instead.
1
1722
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 image for a record and want to display all images for that record. Has anyone done this with ASPUpload that might be able to look at my code and give me some tips? ----------------------------- This message is posted by http://Asp.ForumsZone.com
1
2375
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 from the ASPUpload site), then I want to rename the image to a number, namely the value of an autonumber field in my Access database. i.e. 1.jpg, 2.jpg etc
6
4092
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
2423
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 Desenvolvimento Web
5
4969
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, Ext DIM Mail, strMsgHeader
8
2716
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 that I could use the @@Identity command but cannot get this to function. Has anyone used this command with ASPUpload with an success, or any other methods that could be used? Thanks.
0
3140
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. Anybody can help? The form page goes to upload.asp, where inside upload.asp it calls the class which reads the form element and return back the values. Here is the code of the class. Class pluginFileTransfer Public path,...
5
1311
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. What I need to do is while iterating through the for each loop for each picture I need to identify each picture as "picture_1", "picture_2", "picture_3" in the database. When the story is called it will deliver 3 pictures in specific places so I...
0
7996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8405
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8273
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6735
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5878
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3951
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.