Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : having trouble inserting sound files into database Signup · Login
Author Thread
having trouble inserting sound files into database
Posted in tutorial: Displaying Images from an Access Database using plain ASP
·  zekoder
User
Joined: 3 Oct 2007
Total Posts: 3
having trouble inserting sound files into database
Posted: 3 Oct 2007
Hi Faisal,

I am working on a ASP project using SQL Server 2005 and i used your loader, insert, file codes to insert binary data into the database. The problem is i want to insert sound file (mp3 and wav) into my database. Such files are less than 1MB. Other images and files are inserted properly except from mp3, wav or other sound file format. The following error is generated when i try insert sound file:

Request object error 'ASP 0104 : 80004005'

Operation not Allowed

/loader.asp, line 30

Public Sub Initialize
If Request.TotalBytes > 0 Then
Dim binData
binData = Request.BinaryRead (Request.TotalBytes) 'line 30
getData binData
End If
End Sub


On the other hand at certain times, when i want to upload file i receive the floowing error:
Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument: 'MidB'

/loader.asp, line 135

the line in question is:

Private Sub getData(rawData)
Dim separator
separator = MidB(rawData, 1, InstrB(1, rawData, ChrB(13)) - 1) 'line 135


A third issue i have it's when displaying files into the browser.Ultimately i would like the user to be prompted a Download dialog box with save as option. Using your file.asp code here's the error i get:

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/file.asp, line 28

here's the line in question:
Response.AddHeader "Content-Disposition", "filename="&_
rs("message_filename")


Would you please assist me, i'm so stuck by that.

Thanks



Zekoder
In quest of smart programming
·  zekoder
User
Joined: 3 Oct 2007
Total Posts: 3
having trouble inserting sound files into database
Posted: 4 Oct 2007
Hi Faisal,

First of all, i must say your codes are easier to use and smart. Thanks for making them freely available to us. One of the issues i raised earlier in my earlier questions to you, has been resolved. Which means i can download files using file.asp, the issue i had with line 30 i managed to resolve it. It was around some sql statement syntax error.

The question remains whether it is possible to upload mp3 files into database using the loader codes. In the database i use varbinary (max) intead of image. Related to this are the errors i'm getting in the loader.asp codes lines 135 and 28.

Thanks

Zekoder
In quest of smart programming
·  zekoder
User
Joined: 3 Oct 2007
Total Posts: 3
nothing wrong with loader file
Posted: 9 Oct 2007
I've resolved all issues i had relating to uploading of sound format files. The file loader.asp is working perfectly and doesn't need any changes to upload any file. I read a comment here about changing the AspMaxRequestEntityAllowed value in the inetsrv and that's sorted everything.

Of all the codes i have tried in this uploading of large file exercise, Faisal's codes are the ones that work and there are really simple and straighfoward

Zekoder
In quest of smart programming
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 547
Re:
Posted: 9 Oct 2007
Hi zekoder, it is really great to know that you were able to fix the problem yourself. I am sorry that I didn't see your post earlier. Anyways, good work, and all the best to your programming project.

Faisal Khan.
Stardeveloper.com

Users Who Have Visited This Thread In Last 24 Hours
6 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.