I have a PHP script with uploads an image from a form and saves it as a
medumblob in a MySQL database. So far so
good.
The problems turn up when I want to resize the image before it gets saved in the database, without making files. Is it possible to resize and save the image in the database without making temoporary files etc?
Some code that may be relevant:
$data_lav = addslashes(fread(fopen($bilde_lav, "r"),
filesize($bilde_lav)));
if ($bilde_hoy != "none")
$data_hoy = addslashes(fread(fopen($bilde_hoy, "r"),
filesize($bilde_hoy)));
$query = "INSERT INTO bilder (personid, bilde_lav,
filnavn_lav, filstr_lav, filtype_lav) VALUES ('$id',
'$data_lav', '$bilde_lav_name', '$bilde_lav_size',
'$bilde_lav_type')";
$result = mysql_query($query);
print("Image saved.");
Thanks!
-Axel