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, 'static/images')
photos = UploadSet("photos", IMAGES)
configure_uploads(app, photos)
patch_request_class(app)
what could be the issue. Can I get any help on how to resolve the problem
Very recently,
patch_request_classwas removed fromFlask-Reuploaded, the maintained fork ofFlask-Uploads, which gets installed asflask_uploadsto stay compatible (and so you did not need to change imports).Are you sure you use
Flask-Uploadsand notFlask-Reuploaded? Have a look at your requirements.txt or setup.py.Here is the commit where
patch_request_classgets removed.As you can read,
patch_request_classwas deprecated for a long time already, and it was only necessary to restrict uploads up to Flask version 0.6. Since then you can use theMAX_CONTENT_LENGTHenvironment variable of Flask itself, see https://flask.palletsprojects.com/en/1.1.x/config/#MAX_CONTENT_LENGTHtl/dr
patch_request_classimportpatch_request_class(app)MAX_CONTENT_LENGTHto desired value