开发者

How to copy a file via the browser to Amazon S3 using Python (and boto)?

Creating a file (key) into Amazon S3 using Python (and boto) is not a problem. With this code, I can connect to a bucket and create a key with a specific content:

bucket_instance = connection.get_bucket('bucketname')
key = bucket_instance.new_key('testfile.txt')
key.set_contents_from_string('Content for File')

I want to upload a file via the browser (file dialogue) into Amazon S3.

How can I realize this开发者_开发知识库 with boto?

Thanks in advance


You can't do this with boto, because what you're asking for is purely client-side - there's no direct involvement from the server except to generate the form to post.

What you need to use is Amazon's browser-based upload with POST support. There's a demo of it here.


do you mean this one? Upload files in Google App Engine

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜