SunQuest
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 16th, 2003, 02:33 PM
gotspy's Avatar
gotspy gotspy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Buffalo, NY
Posts: 156 gotspy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 59 m 53 sec
Reputation Power: 6
Store and retrieve images in SQL

I need to create a form that will allow the user to browse for an image to upload.

The image needs to be stored in an inmage datatype in SQL (MS SQL).

Then I need to be able to select the image to be viewed later.

I use cold fusion all the time, but I've never stored an image or any kind of binary in the DB, so I have no idea how to do it.

I'm trying to just manually store an image in my table right now, so I can see if I can display it. Any tips there would be helpful there too.

Any help would be greatly appreciated. Thanks in advance.
__________________
Forget Milk!
Gotspy?

www.gotspy.com

Reply With Quote
  #2  
Old December 16th, 2003, 03:54 PM
gotspy's Avatar
gotspy gotspy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Buffalo, NY
Posts: 156 gotspy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 59 m 53 sec
Reputation Power: 6
Nevermind

I found a better way to do it. Thanks.

I guess the better question now is, how do I delete this post?

Reply With Quote
  #3  
Old December 16th, 2003, 08:30 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,611 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 10 m 21 sec
Reputation Power: 53
I believe that you could do this as a BLOB. But a much easier way to do it is to store the image in your file system somewhere, and then store the *path* to the image in the database.

Reply With Quote
  #4  
Old December 17th, 2003, 07:34 AM
gotspy's Avatar
gotspy gotspy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Buffalo, NY
Posts: 156 gotspy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 59 m 53 sec
Reputation Power: 6
You're right. After making my second post last night I realized it would be nice if I told everyone what I had figured out.

After finding posts about this subject on other forums, 100% suggested NOT to put it in the DB and keep it on the file system instead.

So that's what I'm doing. There is one image per record, so when the user uploads the file, I change the name to be the same as the record_id. So if the record_id is 35, the image is changed to 35.jpg.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Store and retrieve images in SQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway