- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
Hello,
Thank you for reaching out to us.
I understand you are observing issue while rendering the image downloading from S3 bucket using Amplify. You are trying to render the image in iOS simulator using Expo.
Thank you for sharing the screen shot of the code and the issue being observed. From the images, I can see the signed URL is being generated from the Storage.get()
function. Furthermore, when this URL is being passed as the source attribute for Image tag, the image is not being rendered. To troubleshoot the issue, I would suggest following troubleshooting steps:
-
From the screen shot, I see the
imageKey
in line 251 underApp.js
has spaces at the start and end. Furthermore, I see those spaces are being URL encoded in the signed URL generated from theStorage.get()
function. The generated URL has the path%20imawgswe.png%20
. Here the%20
is the URL encoding for space ( ). Hence, I would request you to confirm the imageKey is mentioned properly in the code. -
In case mentioning the correct imageKey, the image is still not being rendered, I would suggest to confirm if the image is within the public folder in the root of the S3 bucket. Please note that, by default if no access level is specified,
Storage.get()
function look for the key in the public folder only. Hence the image,imawgswe.png
should be under the/public
folder in the S3 bucket. Please confirm if the file exists by looking into the path in the URL generated from theStorage.get()
function.
I hope with the above troubleshooting steps, you should be able to resolve the issue of image not being rendered.
Additionally, I would suggest to include the alt
attribute in the Image tag to confirm if the image already loaded or there are any issues while loading the image. Please refer to the third party document for more information on the same. Having said that, please feel free to attach any follow up queries you may have. I should be delighted to assist you further.
Have an excellent rest of the day and stay safe!
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 3 anni fa