Questions tagged [flask-uploads]

Flask-Uploads allows your application to flexibly and efficiently handle file uploading and serving the uploaded files. You can create different sets of uploads - one for document attachments, one for photos, etc. - and the application can be configured to save them all in different places and to generate different URLs for them.

77 questions
2
votes
2 answers

Flask-Uploads always throwing 'UploadNotAllowed' error even with no constraints

Flask-uploads has something called UploadSet which is described as a "single collection of files". I can use this upload set to save my file to a predefined location. I've defined my setup: app = Flask(__name__) app.config['UPLOADS_DEFAULT_DEST'] =…
rublex
  • 1,893
  • 5
  • 27
  • 45
2
votes
1 answer

Flask Uploads Photo class

Trying to write a website that will allow users to upload photos, and so far, I've been using the Flask-Uploads library (docs here) Used in the example in the docs is a class Photo that seems fairly critical: rec = Photo(filename=filename,…
1
vote
0 answers

Upload a file from react to flask is not working

I'm trying to upload a video from react to flask but when I make a POST request it gives me this error werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand. KeyError:…
Koussay Dhifi
  • 35
  • 1
  • 5
1
vote
1 answer

problem to upload and play a video flask?

I m trying to upload a video and play it in an html page using flask but the problem is that it is not playing .I used the code bellow : UPLOAD_FOLDER = 'static/' @app.route('/') def upload_form(): return…
fatima
  • 23
  • 5
1
vote
2 answers

Handling Flask-Reuploaded error when uploading a file with a disallowed filetype or no file

Hello, I am trying to handle errors when uploading a file with a disallowed filetype or when submiting without selecting any file. All I get is "flask_uploads.exceptions.UploadNotAllowed" and on the web page "Internal Server Error". I want to flash…
Endriu Andrei
  • 53
  • 1
  • 5
1
vote
1 answer

I am using flask_uploads and am getting this error ImportError: cannot import name 'patch_request_class' from 'flask_uploads'

my code looks like this from flask_uploads import IMAGES, UploadSet, configure_uploads, patch_request_class import os basedir = os.path.abspath(os.path.dirname(__file__)) app.config['UPLOADED_PHOTOS_DEST'] = os.path.join(basedir,…
Victor02
  • 15
  • 5
1
vote
1 answer

How can I upload folders with flask?

I need to have a feature on my Flask app to let users upload whole folders, not the files within them but to also keep the whole tree of folders. Is there a special feature within Flask or do I need to create a code with loops using the single file…
1
vote
1 answer

Flask flask_uploads.UploadNotAllowed error

I am using flask to handle image uploads and whenever I upload a jpg, jpeg, or png the program I made is able to handle the upload. However, whenever uploading a .jfif image the program returns the error flask_uploads.UploadNotAllowed. Thanks for…
Python 123
  • 59
  • 1
  • 13
1
vote
1 answer

Flask RuntimeError: no destination for set images

I am getting below error when run flask app and this issue start appearing after I migrate to the application from window to linux, on windows 10 flask is working fine. I have installed all dependency and it looks to me some configuration error so…
ravindert
  • 33
  • 4
1
vote
1 answer

"RuntimeError: no destination for set photos" using flask-reuploaded

I'm practicing with flask and uploads and I'm encountering some issues. Firts I downloaded flask-uploads to manage uploads of file but I figured out that this package have problem so I moved to Flask-Reuploaded and everything seems working…
lorenzo
  • 21
  • 5
1
vote
3 answers

Flask File Upload Permission Denied

I am hosting a web application on my server 8Ubuntu 18.04 using Flask. The goal of my application is to upload a upload a picture (or any kind of files for now). However, when attempting to upload a file to the img folder I get permissions error : …
lolaa
  • 181
  • 1
  • 4
  • 11
1
vote
1 answer

Flask upload couldn't serve image files with Hebrew letters in the file name

My problem is that Flask upload couldn't serve image files with Hebrew letters in the file name. This is my form : from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, TextAreaField from wtforms.validators…
Yosef Cohen
  • 91
  • 2
  • 8
1
vote
0 answers

storage must be a werkzeug.FileStorage(FLASK-UPLOAD)

Hello Everyone, This is my first time here. I have been having issues regarding the flask_upload to upload the files. I am not sure where I am going wrong with the flask_upload. Hence every time I have been trying to upload the file it is throwing…
1
vote
1 answer

Flask-WTF 'FileField' object has no attribute 'has_file'

I combine Flask-WTF and Flask-upload to handle file upload on my App. My package versions are: Flask-Uploads==0.2.1 Flask-WTF==0.11 WTForms==2.1 Here is the snippet of my code: forms.py from flask_wtf import Form from flask_wtf.file import…
Tri
  • 2,722
  • 5
  • 36
  • 65
1
vote
1 answer

Flask-Uploads will not enforce allowing only .csv files

I'm using Flask, Flask-Bootstrap and Flask-Uploads with Python 3.7.1 to create a very simple application that accepts a csv file containing raw data. The 'upload' page must allow only .csv files to be uploaded. I have tried to implement the answer…
Nick Tyler
  • 13
  • 4