PUT to pre-signed URL has empty response body, can't retrieve object ID

Hi everyone,

Your help would be greatly appreciated! This is probably a very easy one for someone in the know.

When I’m uploading to my R2 bucket, my upload works and is successful; although I can’t work out how to get the object ID of the content I just uploaded.

Am I supposed to get the object ID from the pre-signing process? Or from the actual PUT?
The response from the PUT request is empty, nothing in the body at all… their is an Etag in the header but that’s all.

When I use a pre-signed URL to put the image in a <img src=“” the image works correctly, everything is fine… so it’s like the upload has worked, just no object ID provided.

I just can’t work out how to get the Object ID of the image?

I need this in order to use the image in Cloudflare Image transformations.

Thank you so much for your time!
Anthony

Here is my PHP pre-signing code
$bucket_name = x;
$account_id = x;
$access_key_id = x;
$access_key_secret = x;
$credentials = new Aws\Credentials\Credentials ($access_key_id, $access_key_secret);
$options = [
‘region’ => ‘auto’,
‘endpoint’ => x,
‘version’ => ‘latest’,
‘credentials’ => $credentials
];
$r2_client = new Aws\S3\S3Client ($options);
$cmd = $r2_client->getCommand (‘GetObject’, [
‘Bucket’ => $bucket_name,
‘Key’ => $file_name
]);
$request = $r2_client->createPresignedRequest ($cmd, ‘+5 minute’);
$url = ((string) $request->getUri ());
return $url;

Here is the jQuery code that does the actual PUT:
$.ajax ({
cache: false,
contentType: false,
data: file,
enctype: false,
processData: false,
type: ‘PUT’,
url: response.url,
success: function (d) {
console.log (d); // This response is empty

Come on guys?! I’ve put in so much time trying to work with your platform here!

I don’t want to be contacting your team, especially not with such simple questions that I can’t work out from the provided docs and forum posts, etc.

If you’re able to please take some time to answer questions and expand upon your documentation, you’re going to get less people hassling you with questions!

Mine is really simple…

I’m just trying to get a pre-signed image, that’s stored in an R2 bucket, to do an Images transformation and display the output of that transformation.

This should be easy and I’ve put hours upon hours upon hours into it… because the documents don’t break it down.

Can someone PLEASE take 5 minutes to get back to me?!
You’ve got a great product here, I want to integrate it into my businesses… but I, like many need your help.

Please take the time to expand on your documentation as how do you expect me to pay for and implement your product when I can’t get it working; in it’s most basic context?!?!

Thank you,
Anthony

This topic was automatically closed after 15 days. New replies are no longer allowed.