Reputation: 64853
I need to generate HTML files on the fly and save them to selected folder of the bucket and received the url.
I have seen uploading a file boto however I want to dynamically generate string of HTML a file on amazon s3 without actually saving the file to my local computer.
How can I achieve this?
Upvotes: 4
Views: 1500
Reputation: 45906
The example you cite uses the set_contents_from_filename
method of the Key object to upload content to S3 from a local file. Alternatively, you could use the set_contents_from_string
method of the Key object to upload content from your generated string of HTML. The first argument is the string to upload rather than a path to a file.
Upvotes: 5