将图片上传到免费图片托管网站
我正在编写一个应用程序,允许用户使用 Android 手机拍照,然后将其上传到图像托管网站(picassa、flikr 或其他可以拥有公共 URL 的免费网站(公共访问 URL 部分很重要) )。
问题是:图片被上传到“全局”帐户 - 就像应用程序的所有用户都将他们的图片上传到同一个帐户一样。 第二个要点:上传过程应该是透明的,应该返回 URL,但不应发生登录/身份验证过程。 (用户无法知道通行证)。
我已经查找了如何创建一个 Web 实例,然后让用户登录,但我不知道如何避免身份验证过程并使整个过程对用户透明,或者即使这是可能的。
I am writing an app that allows the user to take a picture with their android phone and then upload it to an image hosting site (picassa, flikr, or some other free site that can have public URL's (the public access URL part is important) ).
The catch: the picture is uploaded to a "global" account -- as in all of the users of the app upload their pictures to the same account.
The second catch: the upload process should be transparent, a URL should be returned, but no login / auth process should occur. (the user's can't know the pass).
I have looked up how to create a web instance and then have the user log in, but I don't know how to avoid the auth process and make the whole thing transparent to the user, or even if it is possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,您想要存储用户凭据(登录名和密码)并使用它对服务器进行身份验证。
您应该使用这些服务的专用 API:
- FLickr:http://www.flickr.com/services/api/upload。 api.html
和身份验证 api : http://www.flickr.com/services/api/auth .spec.html
- picassa :http://code.google.com/apis/picasa/
所以有了这些api 用户不必知道登录名/密码。上传是透明的。并且您应该获取上传图片的 url。
但有一件事:通过这个解决方案,Android 必须知道通行证。唯一的解决方法是使用 api(并存储密码)在 Android 应用程序之间建立一个服务器。
So you want to store user credential (login and password) and using it to authentificate against the serveur.
You should use the dedicated apis of these services:
- FLickr : http://www.flickr.com/services/api/upload.api.html
and authentification api : http://www.flickr.com/services/api/auth.spec.html
- picassa : http://code.google.com/apis/picasa/
So with these apis the user don't have to know the login/pass. Upload is transparent. And you should get the url of the uploaded picture.
But one thing : with this solution, the android HAVE to know the pass. The only workaround is having a server between your android application using the api (and storing the password).
尝试免费版本的 API https://cloudinary.com/
Flickr 一切都很好。
try free version of APIs at https://cloudinary.com/
Flickr is all good.