Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route("/upload/<filename>", methods=["POST", "PUT"])
- def upload_process(filename):
- filename = secure_filename(filename)
- fileFullPath = os.path.join(application.config['UPLOAD_FOLDER'], filename)
- with open(fileFullPath, "wb") as f:
- chunk_size = 4096
- while True:
- chunk = flask.request.stream.read(chunk_size)
- if len(chunk) == 0:
- return
- f.write(chunk)
- return jsonify({'filename': filename})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement