1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
2
Based on the send_file() function, am I right that you're using Flask? If the files are small, it might be easier to just keep the file in memory (using get_object()) rather than downloading it to the server's filesystem. For example, something like:
s3_result = s3.get_object(Bucket='bucket', Key='key') response = make_response(s3_result['Body'].read()) response.headers['Content-Disposition'] = 'attachment; filename=myfile.txt' response.mimetype = 'text/plain' # or whatever the MIME type is of your file return response
If the files are large, you could instead redirect the user to a presigned url (which you can generate using boto3).
répondu il y a 2 ans
Contenus pertinents
- demandé il y a 7 mois
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 5 mois
- AWS OFFICIELA mis à jour il y a 5 mois