I have problem!
I can get image and resize it by imagecopyresampled()
.
But when I try to use ftp_put()
: expects parameter 3 to be a valid path.
I try to use:
ob_start();
imagejpeg($resource, NULL);
$resource = ob_get_contents();
It does not help. I don't need to save the image to a local machine.
Use an FTP protocol wrapper, like:
imagejpeg($resource, "ftp://user:[email protected]/dir/file.jpg");
A more generic "upload in-memory contents to FTP" would be:
ob_start();
imagejpeg($resource, NULL);
$contents = ob_get_contents();
file_put_contents("ftp://user:[email protected]/dir/file.jpg", $contents);
See also Transfer in-memory data to FTP server without using intermediate file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With