-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uploading blob to S3 signed url, results in empty file #5915
Comments
Is this issue open or closed ? |
@puneethkumarvh Hi Puneeth, It's open and relevant, we had to use the alternative methods to upload blob in our project |
Do you know what the Content-Type is that is being used? |
I tested using the |
Could you give more details of the environment? I tried to reproduce the following steps: Create an account in Amazon
const url = await s3.getSignedUrlPromise('putObject', {
Bucket: 'ianitobucket',
Key: 'arquivo_para_teste',
Expires: 60*60*24*7,
ContentType: 'image/png',
}); The result is a URL pre-signed, with it I used Axios to make a request using the code: import axios from 'axios';
const uploadUrl = 'https://ianitobucket.s3.amazonaws.com/...';
const imageFilePath = 'https://files.tecnoblog.net/wp-content/uploads/2021/10/logotipo-da-empresa-amazon.png'; // URL EXAMPLE
const ImageResponse = await fetch(imageFilePath);
const imageBlob = await ImageResponse.blob();
await axios.put(uploadUrl, imageBlob, {
headers: {
'Content-Type': 'image/png',
'Content-Length': imageBlob.size.toString(),
},
});
console.log('uploaded'); Everything seems okay, the image was uploaded with content. Environment: Node: v18.17.1 |
@ianitow I am running the code in react-native |
Same here, i get the same error :T |
Our team is encountering this as well. |
Any have solution, i am using react native 0.74, so tired |
How is this still an issue? |
Describe the bug
Related to #3442
Sending a blob using
results in an empty file on the S3 bucket. The request has a Content-Length of a few bytes, so s3 is not the origin of the problem
To Reproduce
Code snippet
No response
Expected behavior
using the exact function with same headers and blob,
fetch
andXMLHttpRequest
works finefetch
XMLHttpRequest
Axios Version
1.5.0
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
react-native `0.72.4`
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: