Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when trying to upload several files after each other.

Status
Not open for further replies.

N3XuS

Programmer
Joined
Mar 1, 2002
Messages
339
Location
BE
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x6e8 Thread 0x810 DBC 0xfd54024 Jet'.

/upload.asp, line 46


The uploading works on my local test server. And it also works when I upload just one file.
Line 46 in upload.asp: biData = Request.BinaryRead(Request.TotalBytes) It's weird that this line gives an error as the error has little to nothing to do with the uploading but with the database inserts.

For Each File In Uploader.Files.Items
txtLoc = File.FileName
if i = 0 then
strSQL = "INSERT INTO media (TypeID,MediaID,txtLoc,PlaatsID) VALUES('1','" & Request.QueryString("project") & "','" & txtLoc & "','100');"
cnnMedia.Execute(strSQL)
end if
i = 1
strSQL = "INSERT INTO media (TypeID,MediaID,txtLoc,PlaatsID) VALUES('" & typeID & "','" & Request.QueryString("project") & "','" & txtLoc & "','" & plaatsID & "');"
cnnMedia.Execute(strSQL)
File.SaveToDisk uploadsDirVar

Response.Write &quot;Verstuurd bestand : &quot; & File.FileName & &quot;<br>&quot;
Response.Write &quot;Grootte : &quot; & File.FileSize & &quot; bytes<br>&quot;
Response.Write &quot;Bestandstype : &quot; & File.ContentType & &quot;<br><br>&quot;

Next

It looks like the database is still locked for writing when I try to insert the second record. Am I executing my querys wrong ? should I build in a delay between the 2 inserts ?

thanks
 
When using the file.upload, do you still have access to the querystring? Make sure that you strSQL looks right when executing it. I seem to remember that you need to do it differently when uploading...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
weird, must've forgotten about this thread sorry :)
Well teh reason why I had this problem seemed to be because of the 2 inserts right after each other.
I'm pretty sure the DB is still write protecten when I try to do the 2nd Insert or something...
So I changed that and do the 1st one somewhere else.
That fixed it on my test server but not the live one :(

Still no clue on how to fix this :s
 
Here's the current code :
I even tried just putting the values in without variables giving the value. To no use :(
The only problem seems to be the inserting too fast or something, because I even disabled the uploading and trying to just do pure insert.

If Uploader.Files.Count = 0 Then
Response.Write &quot;Error: File(s) zijn niet geupload&quot;
Response.Write &quot;Contacteer uw webmaster.&quot;
response.Write(&quot;<script language=&quot; & CHR(34) & &quot;javascript&quot; & CHR(34) & &quot;>parent.invoer.verzenden(false);</script>&quot;)
Else
For Each File In Uploader.Files.Items
txtLoc = File.FileName
'if i = 0 then
'strSQL = &quot;INSERT INTO media (TypeID,MediaID,txtLoc,PlaatsID) VALUES('1','&quot; & Request.QueryString(&quot;project&quot;) & &quot;','&quot; & txtLoc & &quot;','100');&quot;
'cnnMedia.Execute(strSQL)
'end if

i = 1
'strSQL = &quot;INSERT INTO media (TypeID,MediaID,txtLoc,PlaatsID) VALUES('&quot; & typeID & &quot;','&quot; & Request.QueryString(&quot;project&quot;) & &quot;','&quot; & txtLoc & &quot;','&quot; & plaatsID & &quot;');&quot;
strSQL = &quot;INSERT INTO media (TypeID,MediaID,txtLoc,PlaatsID) VALUES('9','100','hallo','200');&quot;
cnnMedia.Execute(strSQL)
File.SaveToDisk uploadsDirVar

Response.Write &quot;Verstuurd bestand : &quot; & File.FileName & &quot;<br>&quot;
Response.Write &quot;Grootte : &quot; & File.FileSize & &quot; bytes<br>&quot;
Response.Write &quot;Bestandstype : &quot; & File.ContentType & &quot;<br><br>&quot;

Next
%>
 
I tried opening and closing the DB before and after each INSERT. The result is
Request object error 'ASP 0104 : 80004005'

Operation not Allowed

/upload.asp, line 46

Line 46 in upload.asp: biData = Request.BinaryRead(Request.TotalBytes)
 
Oh forgot to mention that when I take out the INSERT part the files are all getting uploaded just fine.
 
Ok just found out that small files are giving no problem ?????
only above a certain amount of time it does. Which could explain why it works on my test server since it uploads a lot faster here.
Why is it a problem how big the files are ?
I'm speaking in terms of 1MB tops and tests worked up to 200kb then started giving errors.

please help :(
 
Solved this:

Question:


--------------------------------------------------------------------------------
Does Pure ASP Upload support uploading large files on Windows 2003 server? I'm getting the following error:
Request object error 'ASP 0104 : 80004005'
Operation not Allowed
/ScriptLibrary/incPureUpload.asp, line 40




Answer:


--------------------------------------------------------------------------------

Yes, Pure ASP Upload supports uploading large files on the Windows 2003 server. However:

IIS6.0 prevent the upload of files more than +200Kb. So you need to make some changes in the default IIS settings first.

Background
For IIS6.0 users, the AspMaxRequestEntityAllowed property specifies the maximum number of bytes allowed in the entity body of an ASP request. If a Content-Length header is present and specifies an amount of data greater than the value of AspMaxRequestEntityAllowed, IIS returns a 403 error response.

This property is related in function to MaxRequestEntityAllowed, but is specific to ASP request. Whereas you might set the MaxRequestEntityAllowed property to 1 MB at the general World Wide Web Publishing Service ( level, you may choose to set AspMaxRequestEntityAllowed to a lower value, if you know that your specific ASP applications handle a smaller amount of data.

Solution
Open your metabase.XML which is located in c:\Windows\System32\Inetsrv find the line &quot;AspMaxRequestEntityAllowed&quot; and change it to &quot;1073741824&quot;. This is 1GB - of course you can enter another value to suite your needs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top