According to the docs, contentType is optional and it will attempt to determine the correct mime-type based on the file extension. However, it never seemed to guess the mime-type and always defaults to application/octet-stream
Here's my code:
$s3 = new AmazonS3();
$opt = array( 'fileUpload' => $_FILES['file']['tmp_name'],
'storage' => Amazons3::STORAGE_REDUCED);
$r = $s3->create_object('mybucket', $_FILES['file']['name'], $opt);
Here's a screenshot of my AWS console:
How do you actually automatically set the proper Content Type without setting contentType option, or do you really have to set it manually?
Additional info: If I download a file from the console (that I originally uploaded through SDK) then upload it again using the console, the proper Content-Type is set (ex: image/gif for GIF files instead of application/octet-stream)