简体   繁体   English

使用S3进行身份验证来自服务器端时,如何从android(客户端)调用AWS S3图像URL(php + aws sdk php v3)

[英]How to call AWS S3 image URL from android(Client) when the authentication with S3 is from server-side(php+ aws sdk php v3)

I have android as front-end, (php,mysql) as back-end and AWS as the infrastructure host. 我将android作为前端,将(php,mysql)作为后端,将AWS作为基础架构主机。 I am developing APIs using laravel to be consumed by the android app but having problem figuring out how to display images hosted on S3 in android. 我正在使用laravel开发要由android应用程序使用的API,但在弄清楚如何显示android中S3上托管的图像时遇到了问题。
I am able to fetch (private)resource URL from S3 using the AWS PHP SDK's getObjectURL method but I can't pass the URL alone as an image src in Android as the URL does not contain credentials and authentication is only happening from server side. 我可以使用AWS PHP SDK的getObjectURL方法从S3获取(私有)资源URL,但是我无法单独将URL作为Android中的图像src传递,因为该URL不包含凭证并且身份验证仅在服务器端进行。
Should I first download images from S3 to my server, cache it and serve to Android or is there a way I can have android directly access the images from the URL ie can i append credentials with URL? 我应该先将图像从S3下载到我的服务器上,将其缓存并提供给Android,还是可以让android直接从URL访问图像,即我可以在URL后面附加凭证吗?

您可以使用Andriod SDK从s3存储桶中直接访问图像,请参见: https : //docs.aws.amazon.com/mobile/sdkforandroid/developerguide/s3transferutility.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM