The expression "binary data" is ambiguous, everything is binary here.
The PHP function imagecreatefromjpeg()
opens a file, reads its (binary) data ("jpeg image"), and converts it to some binary representation that PHP uses ("php image"). I don't think you can/should pass that binary data to Amazon, when it's expecting a "raw image". If you have a php image and want to use $s3->create_object()
, then I'd reconvert it to some binary image format (eg imagejpeg()
) and send that data.