Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 September 14th, 2006, 06:11 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default download data ("image") from SQL database problems

Hello every body, I am trying in ASP to upload and download pictures in a mysql database. AND I have some problem with the download, could you help me???

my code is the following:

for the upload:
'Conn.Execute("INSERT Push.imageupload(user_id,image_full,image_desc) VALUES('1',LOAD_FILE('/azerty/qsdfgh.jpeg'))")

(the field which contain the picture is a longblob type)

for the download:

  SQL = "select image from XXX.YYY"
   set RSIDB = conn.Execute(SQL)
   Response.Expires = 0
   Response.Buffer = TRUE
   Response.Clear
   Response.ContentType ="image/JPEG"
   Response.binarywrite RSIDB("image")


And I get this:
ÿØÿàJFIFddÿìDuckyÿîAdobedÀÿÛ†ž&&0$$0,%$$%,;22222;C>>>>>>CCCCCCCCCCCCCC CCCCCCCCCCCCCCC%%4%%4C4))4CCC?2?CCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCÿÀ–f"à ¿Ã„{!1AQa"q‘ ¡±2BðÁRbÑr#3!1Qa"ÿÚ ?é:

I cheched the content type but it is ok, do you have other ideas???
Thanks in advance

 
Old September 14th, 2006, 08:39 AM
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

Reference this post:

http://p2p.wrox.com/topic.asp?TOPIC_ID=48962

Also, are you sending anything else to the response stream besides this image? On the page you are trying to display the images to, is there HTML or anything on the page?

"The one language all programmers understand is profanity."
 
Old September 14th, 2006, 09:02 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default


you are right my friend, I put a response.write before that's why the picture did not display.

thanks for your help!

Alex






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems in Image Data Type ayan.mukherjee VB Databases Basics 0 June 30th, 2008 03:54 AM
Download in Image from Sql Server 2000 using asp surendraparashar Classic ASP Basics 0 December 16th, 2007 11:55 PM
download data ("image") from SQL database problems dcleslie Classic ASP Databases 9 August 29th, 2006 01:10 PM
Problems Displaying an image retrieved from SQL Se jazzcatone ASP.NET 1.x and 2.0 Application Design 2 September 3rd, 2005 09:53 AM
IS There A Way TO Download Data F Sql To Xml File alyeng2000 ASP.NET 1.0 and 1.1 Professional 4 April 28th, 2005 09:22 AM





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