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 8th, 2005, 04:56 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default Save images in Sql Db

Hello,

Using ASP Script, I need to store images from my LOCAL PC to online sql server in blob format.

Please advice!!

NOTE:
The images are located on my LOCAL MECHINE.
Image have to be saved in database.


Thank you,
Zeeshan Ahmed
itHighway

 
Old September 7th, 2005, 08:53 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I worked for the phone book division of a large telco, as well as three other large companies that had to store images. NONE of them store them in blob format its insanely slow and cumbersome. All of them store in SQL a path to get to the file. The also use a number of subdirectores. Say for example you had 999999999 images to store. You should not store them in a single folder you shoud store time in sub folders of no more than 1000 files/folders per. For example 123/456/789 would be the path to the "123456789" identiy value of the image you seek. All large companies use a variation of this method for storing lots of files. If you have more files then follow the logic going deeper, for example 123/456/789/123/456 for really large numbers. DO NOT USE BLOBS if you want any speed at all!!!

 
Old September 9th, 2005, 03:37 PM
Registered User
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

robprell is correct (what you want to do is usally a bad idea).

Did you search? Here's an example:
http://www.support.microsoft.com/sea...de=a&x=14&y=14

 
Old September 9th, 2005, 05:45 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not sure if your simply trying to understand how to use a "blob" with sql or you
want to store images online. If you want to store images online I suggest you do it in
this way. Give each image a name regardless of the incoming name. Say for example rob.jpg.
when your web code recieves the rob.jpg you save it based on the identity value of that imeage.
Say for example this was the 134,596,234th file your recieved. You would save the file in some path
then under that path /134/596/234.jpg this way you don't have to worry if two people send you
a different rob.jpg. Then you go into your table to the identity value of 123596234 and find out
the file name should be rob.jpg. Then you render this file as rob.jpg even though it is physically
stored on your server as /123/496/234.jpg. Does this make what I am trying to say easier to understand?

If you simply want to use the blob functionality of SQL (although I don't see why) please just ask
that in your next reply.

Thanks hope this helps,
Rob


 
Old September 12th, 2005, 04:35 AM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to CarlosV
Default

there 2 ways: if you using a access, you have to sabe de path of the image, and using <img src=<%=rs("path")%>> so you can show the image,but if you using a SQL server, you have 2 ways to: the same way that access or the image property, so you save the image idectry in the SQL server

 
Old October 18th, 2006, 10:39 AM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok so I know every one hates using BLOB and maybe one day I will too. But I want to use both methods. Use BLOB for static images that will be around for a long time or that I just dont access that often and use the file path for large files (i.e. zips and other things).

So I have the page to upload images and files to BLOB (follow this link to see that code http://gettinlucky.net/sample.aspx), but need the retrieve side of it to pull the image or doc or zip back out of the DB.

And I have been searcing to find something to store the file path like has been mentioned in this thread but can only find way to complex (for me the newbie) to do and or not in .net.

If needed i'm running server 2003, .net 2.0, sql 2005 exress.

Thanks for any help that can be provided even if it's a link to a posting or an example.

Thanks
Tim





Similar Threads
Thread Thread Starter Forum Replies Last Post
Load Images from and Save Images to a Database cyndie VB.NET 2 August 17th, 2008 06:42 AM
Using SaveFileDialog to save SQL DB file jscammell VB Databases Basics 4 April 14th, 2007 10:02 AM
display images from DB shs BOOK: Beginning ASP.NET 1.0 11 February 21st, 2006 02:21 AM
how to save images in sql2000 using vb6 vaneza VB How-To 5 August 17th, 2005 03:08 AM
Save Images in Sql Db itHighway Classic ASP Basics 7 August 10th, 2005 01:07 AM





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