Forum Moderators: open

Message Too Old, No Replies

How to insert pictures in Database and large amount of text ?

         

nicknick

6:25 pm on Aug 28, 2008 (gmt 0)

10+ Year Member



1.What do you need on a webpage to upload a picture to a database ?

like a submit button ? but an upload button to search directories and upload ?

2. What do you use for large amounts of text ? big text ?

Demaestro

6:39 pm on Aug 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



nick typically what you do to store images is you create a directory on the site where images can live.

like /uploaded_images/

Then you store the name of the image in the database.

¦ image_name ¦
¦ example.jpg ¦

If you want to have multiple directories you can store the directory name as well

¦ directory_name ¦ image_name ¦
¦ images ¦ example.jpg ¦
¦ private_image ¦ example321.jpg ¦

this way you only store the location and name of the image which is basically a "map" to where the images actually live.

LifeinAsia

6:42 pm on Aug 28, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



1) I personally don't store images in a DB. I just store the file names. There are pros and cons to each way, I just prefer this way. But how to do it will depend on your backend processing language (PHP, Cold Fusion, .NET, etc.).

2) Usually TEXT.

nicknick

7:46 am on Aug 29, 2008 (gmt 0)

10+ Year Member



so your php would be something like this :

<img Src="/directory/<? Echo $imagename; ?>.jpeg" alt="Cape town" id="middle-2">