ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

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:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old August 18th, 2003, 08:18 AM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Arrow insert image

hi

i created a table and a field with blob datatype. now i want to insert an image into the mysql database.

i tried through the insert command but i assume that is not the right way. I gave the path where the picture is stored. but it stores it on the database as a string...

please help me with a procedure so that i can follow easily. I am simply stuck up and cannot resolve this?

thanks tremendously!

Reply With Quote
  #2  
Old August 18th, 2003, 08:35 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I personally **NEVER** insert the image(s) inside my database.
Why?
Because It can/will increase the size of my/the database dramatically.

I'm NOT saying its a BAD thing, in fact, its there for a reason(the blob datatype)

My suggestion to you is :

Instead of INSERTing the image INSIDE the database, simply INSERT the file's PATH("C:\whatever\image1.gif")

Then physically store the image on the hard drive inside a folder.

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old August 18th, 2003, 03:35 PM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 5
Images cannot be inserted using an SQL insert statement.

You have to upload them as binary objects. there are lot of scripts out on the internet that help u upload images.

I remember doing it long back in ASP. But not the details of it very clearly, Sorry!

Reply With Quote
  #4  
Old August 18th, 2003, 03:37 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 54 sec
Reputation Power: 6
Send a message via AIM to unatratnag
good job, you still shouldn't do it, DB overhead on pictures is enourmous, and retardedly unneccesary, store the path, or a link in the DB.

Reply With Quote
  #5  
Old August 18th, 2003, 08:33 PM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
hey thanks all for ur valuable suggestions. But my purpose is on selecting a particular topic from a drop down menu ... a person should be able to see some 3-4 pictures related to it from teh database.

how can i achieve this ?

thanks anyways

Reply With Quote
  #6  
Old August 18th, 2003, 08:41 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 54 sec
Reputation Power: 6
Send a message via AIM to unatratnag
if you do vlince's method with the path you'd just say
img scr="<%=RS("link")%>"

i'm not sure how you have it set up but wherever you'd declare the image source or picture, you'd just past the link from the db.

so when you select a option, you query the db, and the links are identified with another column, so your db would be like

ID topic link
1 FSD D:/..........
2 FSD D:/.........
3 ITS D:/.........


etc, and in the query you'd
Code:
select link from table where topic = 'blah'


then
Code:
 while not RS.eof
            img scr="<%=RS("link")%>
            RS.MoveNext
 loop

Last edited by unatratnag : August 18th, 2003 at 08:53 PM.

Reply With Quote
  #7  
Old August 18th, 2003, 09:23 PM
Doug G Doug G is online now
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,549 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 15 h 29 m 45 sec
Reputation Power: 634
Here is a good tutorial on storing images in a database via asp

http://www.stardeveloper.com/articl...01033101&page=1

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > insert image


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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

IBM Developerworks




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