You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@file_upload.Model
class UserFiles(db.Model):
__tablename __ = "UserFiles"
id = db.Column(db.Integer, primary_key=True)
userFile = file_upload.Column()
userId = db.Column(db.Integer, db.ForeignKey("User.id"))
Here is my upload folder configuration:
app = Flask(name)
app.config["ALLOWED_EXTENSIONS"] = ["jpg", "png", "mov", "mp4", "mpg"]
app.config["MAX_CONTENT_LENGTH"] = 1000 * 1024 * 1024 # 1000mb
app.config["UPLOAD_FOLDER"] = os.path.join(basedir,"./static/uploads")
db = SQLAlchemy(app)
file_upload = FileUpload(app, db)
Not sure if this is a bug or an error on my end, but I have read through the documentation and it seems like this should yield files stored on static/uploads with their full data, but instead they are empty.
The text was updated successfully, but these errors were encountered:
Can you please run this script on your system & check to see if this works, if it doesn't please can you post back your system's OS name & version you're running, thanks.
Joe
Not sure if I am not using file_upload.save_files correctly, but the files that it saves are 0 bytes but have the correct name.
Here is how I am using save_files:
userFileModel = UserFiles(userId=current_user.id)
userFile = file_upload.save_files(userFileModel, files={
"userFile": file,
})
And here is my UserFiles model:
@file_upload.Model
class UserFiles(db.Model):
__tablename __ = "UserFiles"
id = db.Column(db.Integer, primary_key=True)
userFile = file_upload.Column()
userId = db.Column(db.Integer, db.ForeignKey("User.id"))
Here is my upload folder configuration:
app = Flask(name)
app.config["ALLOWED_EXTENSIONS"] = ["jpg", "png", "mov", "mp4", "mpg"]
app.config["MAX_CONTENT_LENGTH"] = 1000 * 1024 * 1024 # 1000mb
app.config["UPLOAD_FOLDER"] = os.path.join(basedir,"./static/uploads")
db = SQLAlchemy(app)
file_upload = FileUpload(app, db)
Not sure if this is a bug or an error on my end, but I have read through the documentation and it seems like this should yield files stored on static/uploads with their full data, but instead they are empty.
The text was updated successfully, but these errors were encountered: