image uploads - part 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks  Robby Russell, Jason Wong , Greg Donald, raditha dissanayak and
every one else who answered part 1 of my email concerning image
uploads.

It was about where to store images uploaded by website users and
question was database vs filesystem and dedicated vs shared hosting 
and the conclusion I could understand was 

fast,secure,cheap pick any two 

1) database + shared = secure and cheap
2) filesystem + shared = fast and cheap
3) filesystem + dedicated = fast and secure
4) database + dedicated =  err.. stupid? ;)

For now I have decided to try option 1 and see how far I can go till
performance begins to become a limiting factor and then decide later if
I really need to, to choose between security and cost.

I have another question. I have used mysql mediumblob to store images.
They are jpeg files. When I retrieve that binary data with a query and
generate an image with PHP .. ie. I do

<?
...
header('Content-type: image/jpeg');
echo $binary_data;
?>

The image gets generated and displayed OK. But when I save that image
file on my work station it gets saved as a huge file .. a file which
was 36 Kb jpg when uploaded is saved as 5Mb bmp when downloaded.  The
data in mysql column is 36 Kb only. So why is it getting saved as such
a huge file and why bmp when header is 'image/jpeg'

thanks
Jas

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux