Upload flask FileStorage to S3

280 技术 , , 发表评论
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…