Created
January 16, 2023 06:51
-
-
Save xxiz/3416f5388047384b1a497c068efe490b to your computer and use it in GitHub Desktop.
read file to memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/upload', methods=['POST']) | |
def upload(): | |
file = request.files['file'] | |
file_contents = file.read().decode() # read the contents of the file and decode it to a string | |
file_like_object = io.StringIO(file_contents) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment