Cómo mostrar la imagen que se almacena en s3 sin almacenar en el disco duro?
-
10-10-2019 - |
Pregunta
En mis rieles APP tengo attachment_fu utiliza para cargar imágenes y almacenados en S3. Quiero mostrar estas imágenes en el navegador sin recuperarlo. ¿Cómo puedo mostrar imágenes dando ruta s3?
Gracias, Jayashri
Solución
You just need to link to the correct S3 path for you images.
For public files they are in the format:
eg http://s3.amazonaws.com/[bucket]/[key]
If your content is private you'll need to create a signed url but all the SDKs and libraries make this easy.
Then use the url to display the images:
<img src="http://s3.amazonaws.com/mybucket/myfile.jpg" ... ></img>
Otros consejos
It may help you to install the S3 organizer in Firefox so you can browser your directories. Then I believe the URL's are structured kinda like this...
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow