Upload flask FileStorage to S3

316 技术 , , Leave a Comment
Flask usesFileStorage as uploaded file object, it's full package name is werkzeug.datastructures.FileStorage. Following is the code to upload it to s3. def upload_file(file_storage: FileStorage): if not file_storage.filename: raise ApiParamError("File can't be empty.") remote_path = secure_filena…