We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do I really have to save my file locally to use TUS?
The code:
@app.route('/upload', methods=['POST']) def upload_file(): if 'file' not in request.files: return jsonify({'error': 'No file part'}) file = request.files['file'] if file.filename == '': return jsonify({'error': 'No selected file'}) tus_client = client.TusClient('http://tusd.tusdemo.net/files/') uploader = tus_client.uploader(file.stream, chunk_size=200) try: # Upload the entire file upload_response = uploader.upload() file_url = upload_response.headers['Location'] return jsonify({'file_url': file_url}) except Exception as e: return jsonify({'error': str(e)})
The error: TypeError: stat: path should be string, bytes, os.PathLike or integer, not SpooledTemporaryFile
The text was updated successfully, but these errors were encountered:
Yes, right now uploads with tus-py-client must be backed by a file on disk, so the client can seek around and resume the upload if necessary.
Sorry, something went wrong.
No branches or pull requests
Do I really have to save my file locally to use TUS?
The code:
The error:
TypeError: stat: path should be string, bytes, os.PathLike or integer, not SpooledTemporaryFile
The text was updated successfully, but these errors were encountered: