
August 11th, 2003, 05:58 AM
|
|
Registered User
|
|
Join Date: Feb 2002
Location: The Netherlands
Posts: 19
Time spent in forums: 1 h 9 m 43 sec
Reputation Power: 0
|
|
|
resize image and upload to ftp problem
I'm making a gallery and now I am having a problem with uploading the thumbnail that I create. The normal file uploads fine to my ftp server but the thumbnail doesn't and I'm not getting any error's either.
This is the part of the script for uploading the thumbnail:
PHP Code:
$sourceimg = ImageCreateFromJPEG($tempnaambestand[$nr]);
$thumbimg = ImageCreate($thumb_width, $thumb_height);
ImageCopyResampled($thumbimg, $sourceimg, 0, 0, 0, 0, $thumb_width, $thumb_height, $dimensions[0], $dimensions[1]);
ob_start();
ImageJPEG($thumbimg, '' , 85);
$thumbnailbestand = ob_get_contents();
ftp_chdir($conn_id, "thumbnails");
ftp_put($conn_id, $naambestand, $thumbnailbestand, FTP_BINARY);
ob_end_clean();
ImageDestroy($thumbimg);
I think the file is stuck in the buffer but I'm not sure and I don't know how to get it out.
Who has the answer?
|