Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2006, 10:14 AM
Registered User
 
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default download problems!

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:


<%
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
 
Old August 28th, 2006, 01:35 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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."
 
Old August 28th, 2006, 02:30 PM
Registered User
 
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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><9a164094c9f546 4bb13590dec7fd38d0>]>> startxref 0 %%EOF 8 0 obj<>stream xÚb```c``Ò`





Quote:
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."





Similar Threads
Thread Thread Starter Forum Replies Last Post
download data ("image") from SQL database problems alex9183 Classic ASP Databases 2 September 14th, 2006 09:02 AM
download data ("image") from SQL database problems dcleslie Classic ASP Databases 9 August 29th, 2006 01:10 PM
Download Code won't download More_Toys BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 15 May 13th, 2006 10:49 AM
Smaller download/single download file available jminatel BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 November 21st, 2005 11:10 AM
validate.asp problems and logon.asp problems p2ptolu Classic ASP Databases 0 February 16th, 2005 02:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.