I have a php script that takes a jpeg received within a String that is a byte array encoded to base64. I don't know what is the correct header options to send to azure and tell it to decode and write the result to a valid jpg file,instead of writing the string to the file, which it does correctly at this moment. I have tried several content types. (image/jpeg). Even sending the raw byte array data. Nothing. Azure writes the file but not correctly as a jpeg.
$contentType = "text/plain; charset=UTF-8";
$curl = curl_init($base_url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: '.$contentType,
'Content-Encoding : BASE64',
'x-ms-version: 2014-02-14',
'x-ms-date: '.$currentTime,
'x-ms-blob-type: BlockBlob',
'x-ms-blob-content-type: '.$contentType,
'Authorization: SharedKey zzzzzstorage:'.$signature
));
curl_setopt($curl, CURLOPT_POSTFIELDS, $encodedImage);
$response = curl_exec($curl);
$the_jpg = base64_decode($encodedImage);
– RiggsFolly