Re: [PHP-DB] Storing Images #2

2010-02-05 Thread elk dolk
-- I have my photos in /public_html/img/gid directory and with this path: img src='http://www.mydomain.com/img/{$gid}/{$photoFileName}' in getImage.php the server displays the photos. Now if I put my photos outside of the

Re: [PHP-DB] Storing Images #2

2010-02-05 Thread Richard Quadling
On 5 February 2010 09:08, elk dolk elkd...@yahoo.com wrote: -- I have my photos in /public_html/img/gid directory and with this path: img src='http://www.mydomain.com/img/{$gid}/{$photoFileName}' in getImage.php the server displays the

[PHP-DB] Storing Images #2

2010-02-04 Thread elk dolk
On 3 February 2010 16:07, wrote: I currently have all my images referenced by url in my database and stored in a folder/s and I think I will keep it that way... .. If you put the images OUTSIDE of the webroot/docroot/public_html

Re: [PHP-DB] Storing Images #2

2010-02-04 Thread Jason Gerfen
If its outside the html root you would need to create a symlink pointing to the appropriate folder % ln -s /path/to/hidden /path/to/public *however this is very insecure Then if your wise you could create a simple image serving script to prevent direct navigation by checking the referring

Re: [PHP-DB] Storing Images #2

2010-02-04 Thread Chris
elk dolk wrote: On 3 February 2010 16:07, wrote: I currently have all my images referenced by url in my database and stored in a folder/s and I think I will keep it that way... .. If you put the images OUTSIDE of the

Fwd: [PHP-DB] Storing images

2010-02-03 Thread Gunawan Wibisono
-- Forwarded message -- From: Gunawan Wibisono landavi...@gmail.com Date: Wed, Feb 3, 2010 at 3:02 PM Subject: Re: [PHP-DB] Storing images To: Karl DeSaulniers k...@designdrumm.com u can do that... but i suggest you not put image to table since there a limit in table i found

Re: [PHP-DB] Storing images

2010-02-03 Thread Phpster
Sure is. Save the data in a blob field. Lots of examples on the net on how to get it there and back out again. Note that you will also find arguments about whether or not to do it in the first place. I prefer not to, as it causes significant performance issues when the image table gets to

Re: [PHP-DB] Storing images

2010-02-03 Thread Patrick Price
I would say that only if this is going to be a very small project should you think about storing the images in the db. I had a contract job for a real estate company that had stored all their images in the database. They had ~25K rows of data where each image was ~5K and their website was going

Re: [PHP-DB] Storing images

2010-02-03 Thread Karl DeSaulniers
Thank you all for your numerous responses. I hear you loud and clear. I was wanting to see if it would be less of a burden on the server and secure my images better to put the images inside a database, but as you all have almost uniformly stated, this would not be the best situation. I

Re: [PHP-DB] Storing images

2010-02-03 Thread Richard Quadling
On 3 February 2010 16:07, Karl DeSaulniers k...@designdrumm.com wrote: Thank you all for your numerous responses. I hear you loud and clear. I was wanting to see if it would be less of a burden on the server and secure my images better to put the images inside a database, but as you all have

Re: [PHP-DB] Storing images

2010-02-03 Thread Karl DeSaulniers
A.. Very nice. I did not think of that. But lets say its a whole bunch of images and multiple people may be accessing them. Is it safe to have them accessing a directory outside the public_html directory? Thanks, Karl On Feb 3, 2010, at 10:14 AM, Richard Quadling wrote: On 3 February

Re: [PHP-DB] Storing images

2010-02-03 Thread Richard Quadling
On 3 February 2010 16:22, Karl DeSaulniers k...@designdrumm.com wrote: A.. Very nice. I did not think of that. But lets say its a whole bunch of images and multiple people may be accessing them. Is it safe to have them accessing a directory outside the public_html directory? Thanks,

Re: [PHP-DB] Storing images

2010-02-03 Thread Karl DeSaulniers
Any pointers on where I can find a sample locking script. I may have artists editing files and that would be great to have a locking of the file while an artist is working on it so no one over writes each other. LMK, Thanks, Karl On Feb 3, 2010, at 10:31 AM, Richard Quadling wrote: If you

Re: [PHP-DB] Storing images

2010-02-03 Thread Richard Quadling
On 3 February 2010 16:35, Karl DeSaulniers k...@designdrumm.com wrote: Any pointers on where I can find a sample locking script. I may have artists editing files and that would be great to have a locking of the file while an artist is working on it so no one over writes each other. LMK,

Re: [PHP-DB] Storing images

2010-02-02 Thread Karl DeSaulniers
Ok, now here is another question from what you stated. Is there a way to compress the image data before storing, like a zip archive does to files? Thanks for your response. Karl On Feb 3, 2010, at 1:45 AM, Chaitanya Yanamadala wrote: It i possible to store the image in the database. But it

RE: [PHP-DB] storing images in database

2005-01-26 Thread Gareth Heyes
if(isset($_GET['id'])) { $id=$_GET['id']; $query = select bin_data, filetype from binary_data where id=$id; This is a really bad example, anybody can inject your query with malicious sql commands. Never trust user supplied data. -- PHP Database Mailing List (http://www.php.net/) To

RE: [PHP-DB] storing images in database

2005-01-26 Thread Bastien Koert
] Subject: RE: [PHP-DB] storing images in database Date: Wed, 26 Jan 2005 13:30:45 + if(isset($_GET['id'])) { $id=$_GET['id']; $query = select bin_data, filetype from binary_data where id=$id; This is a really bad example, anybody can inject your query with malicious sql commands. Never trust

RE: [PHP-DB] storing images in database

2005-01-26 Thread Chip Wiegand
Thanks for all the tips guys. I'll keep the last couple for future reference. -- Chip Gareth Heyes [EMAIL PROTECTED] wrote on 01/26/2005 05:30:45 AM: if(isset($_GET['id'])) { $id=$_GET['id']; $query = select bin_data, filetype from binary_data where id=$id; This is a really bad

[PHP-DB] storing images in database

2005-01-25 Thread Chip Wiegand
I have stored a .jpg image in a database, then when I make a sql statement to display that image on a web page all I get is the cryptic code in place of the image. I am storing it in a row configured as a blob, mime type image/jpeg and binary (using phpMyAdmin). What am I doing wrong? Regards,

Re: [PHP-DB] storing images in database

2005-01-25 Thread Micah Stevens
Could be lots of things, improper/missing headers is most likely, although it's not clear from your statement if you're displaying the binary data directly in the page or are you calling an image output script in an image tag. (as you should) Show some code and the answer will be clear.

RE: [PHP-DB] storing images in database

2005-01-25 Thread Bastien Koert
($query); $data = @MYSQL_RESULT($result,0,bin_data); $type = @MYSQL_RESULT($result,0,filetype); Header( Content-type: $type); echo $data; }; ? bastien From: Chip Wiegand [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Subject: [PHP-DB] storing images in database Date: Tue, 25 Jan 2005 09:11:07

RE: [PHP-DB] storing images in database

2005-01-25 Thread Chip Wiegand
=$id; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,bin_data); $type = @MYSQL_RESULT($result,0,filetype); Header( Content-type: $type); echo $data; }; ? bastien From: Chip Wiegand [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Subject: [PHP-DB] storing

RE: [PHP-DB] storing images in database

2005-01-25 Thread Bastien Koert
Its not src='id=$id' that will defnintely blow up echo 'img src=./path/to/image.php?id=$id'; where $id is the id of the record you are trying to get the image to... Bastien From: Chip Wiegand [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-db@lists.php.net Subject: RE: [PHP-DB] storing images

RE: [PHP-DB] storing images in database

2005-01-25 Thread Bastien Koert
@lists.php.net Subject: RE: [PHP-DB] storing images in database Date: Tue, 25 Jan 2005 12:57:40 -0800 Bastien Koert [EMAIL PROTECTED] wrote on 01/25/2005 12:46:12 PM: yes goes back to the whole header problem which is why you are here. If you could post the code, it would be simpler to help you... Bastien

Re: [PHP-DB] storing images in database

2005-01-25 Thread Martin Norland
Bastien Koert wrote: Its not src='id=$id' that will defnintely blow up echo 'img src=./path/to/image.php?id=$id'; where $id is the id of the record you are trying to get the image to... Bastien From: Chip Wiegand [EMAIL PROTECTED] [snip] In testing this I have added the code samples to a page

RE: [PHP-DB] storing images in database

2005-01-25 Thread Chip Wiegand
the default is the record_id that corresponds back to the id of the row with the image blob field. Bastien From: Chip Wiegand [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: PHP DB php-db@lists.php.net Subject: RE: [PHP-DB] storing images in database Date: Tue, 25 Jan 2005 12:57:40 -0800

RE: [PHP-DB] storing images in database

2005-01-25 Thread Bastien Koert
Filesystem is easier, by far since it avoids the content header. Glad you solved it bastien From: Chip Wiegand [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: PHP DB php-db@lists.php.net Subject: RE: [PHP-DB] storing images in database Date: Tue, 25 Jan 2005 14:32:11 -0800 I have done it an easier

RE: [PHP-DB] storing images in database

2005-01-25 Thread Bastien Koert
. FWIW, I have the image stored in the database in a blob field, is that correct? -- Chip From: Chip Wiegand [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] storing images in database Date: Tue, 25 Jan 2005 12:44:44 -0800 Bastien Koert [EMAIL PROTECTED] wrote on 01/25/2005 12:39

[PHP-DB] storing images in a table or in a directory

2003-08-20 Thread hicham kersit
Hi, I have to manage a large amount of images uploaded by users on my site. Using php/mysql I don't know if I should store the images in a directory within the server or in a dedicated table. What is the most suited method? Thanks, best regards. -- PHP Database Mailing List

Re: [PHP-DB] storing images in a table or in a directory

2003-08-20 Thread Chris Payne
Hi there, Why not do both? Store the images themselves in a dir, but reference them from a table, so that way you can control them pretty much totally via PHP and MySQL. You could them write a system to create thumbnails from selected items in the database or delete certain images etc .

Re: [PHP-DB] storing images in a table or in a directory

2003-08-20 Thread colbey
I store alot in databases.. when you deal with filesystem there can be issues with multiple webservers (need replication using something like rsync, etc).. I've used the db/filesystem link method before aswell but typically go with database nowdays.. You do have to query each time to get

[PHP-DB] Storing images and text retrieved from mysql-db, into a table

2003-03-21 Thread gert vonck
hello, i'm not very good with php and mysql, so this can look like a silly easy question. I have a mysql database named 'oh'. there are 20 tables under it. Now, i want to store 1 image and some text (8 to be exact) in a table. I want to have 1 table with 3 column, and the first two are divided

Re: [PHP-DB] Storing images in MySQL table

2003-02-20 Thread sumbry
The only disadvantage i've had of storing images in DB instead of Filesystem, is that when you use a PHP script to output the image to a client browser, MSIE doesn't always accept a suggested filename so it might try and save it as your-script.php?img=2. Other then that, keeping images in DB

[PHP-DB] Storing images in MySQL table

2003-02-19 Thread ReznicekM
Hi everybody, i want to store some articles and images to them in MySQL db. could you just give advice if it is better to store the image in BLOB or if to save on server and in db just have it's URL. Hi Milan -- PHP Database Mailing List (http://www.php.net/)

Re: [PHP-DB] Storing images in MySQL table

2003-02-19 Thread Corne' Cornelius
Milan, The only disadvantage i've had of storing images in DB instead of Filesystem, is that when you use a PHP script to output the image to a client browser, MSIE doesn't always accept a suggested filename so it might try and save it as your-script.php?img=2. Other then that, keeping images

Re: [PHP-DB] Storing images in MySQL table

2003-02-19 Thread Len Sorensen
On Wed, Feb 19, 2003 at 11:07:28AM +0200, Corne' Cornelius wrote: The only disadvantage i've had of storing images in DB instead of Filesystem, is that when you use a PHP script to output the image to a client browser, MSIE doesn't always accept a suggested filename so it might try and save