Vydia / react-native-background-upload

Upload files in your React Native app even while it's backgrounded. Supports Android and iOS, including camera roll assets.
MIT License
735 stars 336 forks source link

uploading very slow, and did not getting the file on the s3 bucket after it is showing 100 % completed. #319

Open praveenchandel opened 1 year ago

praveenchandel commented 1 year ago

I am trying to upload a video file that is not even large around 10MB, but uploading that is taking more than 2-4 minutes and after it is showing 100% uploaded that is complete, after that when I am hitting the pre-signed URL in that I am not getting the video. the video is not reached to s3 bucket I am trying with this code.

` const options = { url: objectURL, // s3 URL where wanted to upload the file path: filePath, // path of the file method: 'PUT', type: uploadType, // 'raw' or 'multipart' field: 'file', headers: { 'content-type': type, // Customize content-type 'content-length': fileSize, }, parameters: { 'Content-Type': type, 'X-Amz-Algorithm': 'MINE_ONE', 'X-Amz-Date': 'MINE_ONE', 'X-Amz-SignedHeaders': 'MINE_ONE', 'X-Amz-Expires': MINE_ONE, 'X-Amz-Credential': 'MINE_ONEt', 'X-Amz-Signature': 'MINE_ONE', }, };

await Upload.startUpload(options).then((uploadId) => {
  console.log('props Upload started', uploadId);
  Upload.addListener('progress', uploadId, (data) => {
    console.log(`props Progress: ${data.progress}%`);
  });
  Upload.addListener('error', uploadId, (data) => {
    console.log(`props Error: ${data.error}%`);
  });
  Upload.addListener('cancelled', uploadId, (data) => {
    console.log('props Cancelled!', uploadId, '--', data);
  });
  Upload.addListener('completed', uploadId, (data) => {
  // data includes responseCode: number and responseBody: Object
    console.log('props Completed!');
  });
}).catch((err) => {
  console.log('props Upload error!', err);
});`

I have also tried to upload the video after downgrading the library version to (6.2.0) as i got this from the issue : https://github.com/Vydia/react-native-background-upload/issues/310

but It also had the same outcome.

am I doing something wrong. if anyone knows then please help suggestions are welcomed.

amplifilabs commented 1 year ago

Same thing here. Any solution for this?

rahulnainwal107 commented 1 year ago

I am also having same.