Subject: download problems!
Posted By: dcleslie Post Date: 8/28/2006 10:14:34 AM
I am using motobit to download/upload applications. I'm uploading the file as am "image" in SQL Server 2000 but when I go to download, it's giving me an error:
Type Mismatch

/idb/download.asp, line 18

An unhandled data type was encountered.


My code:
<!--#include file="AdoConn.asp"-->

<%
if not isempty(Request.Form("UploadID")) then
    CurrentID = Request.Form("UploadID")
elseif not isempty(Request.QueryString("UploadID")) then
    CurrentID = Request.QueryString("UploadID")
else
    Response.Redirect "index.asp"
end if

set RSIDB = conn.Execute("select * from DCL5.IDBUpload where " _
    & "UploadID = " & CurrentID)
%>


<%
Response.binarywrite RSIDB("data")
%>


Any ideas? I'm fairly new to all of this, so I'm embarrassed that it may be something basic...

thank you!
-DC
Reply By: dparsons Reply Date: 8/28/2006 1:35:11 PM
Hello,
  This is more an ASP question then a SQL question, but no matter.  You say that your uploading and downloading applications, are you changing the content type of the page?

For example if i had a gif image in a table i would make this call BEFORE i wrote the binary data to the http stream:
Response.ContentType = "image/gif"

then i would do this:
Response.BinaryWrite(objRS("Picture"))

For your needs i would do this:

Response.ContentType ="application/octet-stream"
Response.BinaryWrite(RSIDB("data"))

hth

"The one language all programmers understand is profanity."
Reply By: dcleslie Reply Date: 8/28/2006 2:30:28 PM
Of course, more of an ASP question.. sorry.. but since you responded, I thought I'd follow up - I put in your code (Response.ContentType ="application/octet-stream")

and now i get some gibberish (as though the uploaded documented were encoded and can't be decoded)..

%PDF-1.4 %âãÏÓ 6 0 obj<> endobj xref 6 9 0000000016 00000 n 0000000609 00000 n 0000000476 00000 n 0000000685 00000 n 0000000812 00000 n 0000000896 00000 n 0000001162 00000 n 0000001352 00000 n 0000001573 00000 n trailer <<45af1f68c535c24149655e40161ad09b><9a164094c9f5464bb13590dec7fd38d0>]>> startxref 0 %%EOF 8 0 obj<>stream xÚb```c``Ò`





quote:
Originally posted by dparsons

Hello,
  This is more an ASP question then a SQL question, but no matter.  You say that your uploading and downloading applications, are you changing the content type of the page?

For example if i had a gif image in a table i would make this call BEFORE i wrote the binary data to the http stream:
Response.ContentType = "image/gif"

then i would do this:
Response.BinaryWrite(objRS("Picture"))

For your needs i would do this:

Response.ContentType ="application/octet-stream"
Response.BinaryWrite(RSIDB("data"))

hth

"The one language all programmers understand is profanity."




Go to topic 48955

Return to index page 191
Return to index page 190
Return to index page 189
Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183
Return to index page 182