views:

74

answers:

2

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

A: 

do you mean this one? http://stackoverflow.com/questions/81451/upload-files-in-google-app-engine

Dyno Fu
No, I have an application (python + boto 1.9b) running at Google App Engine. I want to implement, that the users can upload files from their clients into their S3-buckets via a HTML-form (file dialogue).
Neverland
+1  A: 

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.

Nick Johnson
This is the solution. I didn't know the upload is purely client-side. Thanks a lot!
Neverland