I'm getting ERR_CONTENT_DECODING_FAILED on r2 public file - It is common issue? When I try to search
I'm getting ERR_CONTENT_DECODING_FAILED on r2 public file - It is common issue? When I try to search in discussions I find results but no solution.

wrangler, rclone or // Retry mechanism
const maxRetries = 3;
let attempt = 0;
let success = false;
let lastError = null;
while (attempt < maxRetries && !success) {
try {
// Upload the file to the bucket
await bucket.put(filePath, await file.arrayBuffer(), {
httpMetadata: {
contentType: file.type,
},
});
success = true;
} catch (error) {
lastError = error;
if (error.message.includes('internal connectivity issue')) {
attempt++;
if (attempt < maxRetries) {
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait 1 second before retrying
}
} else {
break; // If it's a different error, don't retry
}
}
}
if (!success) {
throw lastError;
}awscurl -X PUT "https://${ACCOUNT_ID}.r2.cloudflarestorage.com/${BUCKET_NAME}/${object_key}" \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$FILE_PATH"