Commit b520edb1 authored by contabo-server's avatar contabo-server
Browse files

fixed sercure filename in models

parent e4d3ecbc
......@@ -51,9 +51,9 @@ class Attachment(db.Model):
return f'<Attachment {self.id}, {self.filename} for Share {self.share_id}>'
def __init__(self, share_id, file):
self.share_id = share_id
from werkzeug.utils import secure_filename
fn = secure_filename(filename=file.filename)
self.share_id = share_id
self.filename = fn
# save file
from werkzeug.utils import secure_filename
file.save(os.path.join(current_app.config['MEDIA_LOCATION'], share_id, fn))
......@@ -68,7 +68,7 @@ def public():
return render_template('Public.html', shares=shares)
@app.route('/')
@app.route('/', methods=['GET', 'POST'])
@app.route('/upload', methods=['GET', 'POST'])
def upload():
form = UploadForm()
......
......@@ -4,7 +4,7 @@ Description=Chiefsend Web Service gunicorn Worker
[Service]
Type=simple
WorkingDirectory=/home/chief/chiefsend
ExecStart=/home/chief/chiefsend/venv/bin/gunicorn -b :5000 --workers=3 --log-level=DEBUG --access-logfile /home/chief/chiefsend/log.txt --error-logfile /home/chief/chiefsend/errlog.txt chiefsend:app
ExecStart=/home/chief/chiefsend/venv/bin/gunicorn -b :5000 --workers=3 --access-logfile /home/chief/chiefsend/log.txt --error-logfile /home/chief/chiefsend/errlog.txt chiefsend:app --timeout 200
Restart=on-failure
[Install]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment