Is there any feasible way to upload a file which is generated dynamically to amazon s3 directly without first create a local file and then upload to the s3 server? I use python. Thanks
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You could use BytesIO from the Python standard library.
Given that encryption at rest is a much desired data standard now, smart_open does not support this afaik
You can try using
smart_open
(https://pypi.org/project/smart_open/). I used it exactly for that: writing files directly in S3.Update for boto3:
The boto library's Key object has several methods you might be interested in:
For an example of using set_contents_from_string, see Storing Data section of the boto documentation, pasted here for completeness: