Amplify downloaded files location in react native

Viewed 21

I'm able to download a file from S3 in a react native app with AWS Amplify backend using the storage.get function. However, not able to find where the downloaded files are stored? How can we access the downloaded files content in react native? The Amplify documentation doesn't say where are the files downloaded by default.

1 Answers

Answering my own question. Storage.get has an option to set download to true to download the files. However, I was not able to find the location of the downloaded files. Hence, I switched to getting the signed url first with storage.get by setting download to false and the use the axios to download the file using http get method by passing the signed url.

const signedURL = await Storage.get('test.json');
const response = await axios.get(signedURL);
console.debug('S3 data: ', response.data);
Related