Home > SQL Development > display file from sql database

display file from sql database



i have chosen to load some word files into a sql server database much to many users chagrin i am sure, but none the less, this is the route we have chosen to take. i have used an asp page so the user can upload a file to the database, there is also a page that lists all the files in the databse. in addition i also have a page that is supposed to display the file, however i run into an error on this page. this is the last bit of my code:





If Not rs.EOF Then

Response.ContentType = rs("Content Type")

Response.BinaryWrite rs("File Data")



End If





i get an error message that reads:



Response object error 'ASP 0106 : 80004005'



Type Mismatch



/TaskMan/test/file.asp, line 33



An unhandled data type was encountered.



line 33 is the binarywrite line. does anyone have any experience dealing with this type of situation or any suggestion as to how to remedy the problem?

    
Guest


Type Mismatch

"Response.BinaryWrite" is an ASP problem

Was this answer helpful ? Yes No   
Guest


do you know how to fix this asp problem?

Was this answer helpful ? Yes No   
Guest


I think what m_lazor is trying to say is that you may have better luck posting your question in the asp forum since the problem you are encountering is an asp problem, not a sql problem.

Was this answer helpful ? Yes No   
Guest


Thanks Gregory. I was in a bad mood yesterday and didn't express myself clearly.

At second thought I wonder if displaying word files is possible this way. I wonder if you do not need to create a temp file that you can then load with a meta tag including the correct MIME type. In this scenario you are writing binary data to the document page which is supposed to be in HTML.

Was this answer helpful ? Yes No   
Guest


im not sure if you can do that or not m_lazor, i had thought you could so i was giving it a try. i will post my message on another board, sorry to inconvience you guys.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved