Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 July 20th, 2006, 04:08 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Retrieving image from sql and saving to disk

Hi,

Wondering if anyone could help me out.

I am able to retrieve the images we stored into our sql database. I am able to bring the image up to the browser. Is there a way to save the image to disk?

Here is a sample of my code to display to browser.

sqlStmt = "exec usp_aa_rd_Maintenance "
Set rsGetEmpPic = Connection.execute(sqlstmt)

IF NOT rsGetEmpPic.Eof THEN
    ' read picture length
    nPicLen = rsGetEmpPic("length")
ELSE
    nPicLen = 0
END IF

' if there is a non-zero length image then display image
IF nPicLen > 0 THEN
      sEmpPic = rsGetEmpPic("MUGSHOT")

         response.binaryWrite (sEmpPic)

         rsGetEmpPic.Close

END IF

I tried the SaveBinaryData(sEmpPic) but it keeps on saying "Write to file failed.".

Please advise.
 
Old August 5th, 2006, 01:51 AM
Authorized User
 
Join Date: Nov 2004
Location: CHENNAI, TamilNadu, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tks_muthu
Default

hi,
i think this link is useful for you.
http://www.w3schools.com/ado/met_fie...p?output=print

:)

Muthu




Similar Threads
Thread Thread Starter Forum Replies Last Post
sending and retrieving image to/from sql mosi C# 2005 1 May 10th, 2008 07:51 AM
Uploadng an image and saving path in sql 2000 !!! dagad ASP.NET 2.0 Professional 0 November 1st, 2006 11:39 AM
Uploadng an image and saving path in sql 2000 !!! dagad ASP.NET 2.0 Basics 0 November 1st, 2006 11:38 AM
Saving/Retrieving Image file to Database davekrunal46 VB How-To 6 January 11th, 2006 04:41 AM
Saving image in SQL Server 2000 ashu_from_india ADO.NET 0 February 21st, 2005 01:10 PM





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