diff --git a/README.md b/README.md index 5fbd6c9..9cc3943 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ gunicorn. Here is an example below: class uploadr: domain = "example.com" port = 8005 + uploads = '/home/dannydevito/uploads' # folder where uploaded files will be stored + qrcodes = '/home/dannydevito/qrcodes' # folder where generated qr codes will be stored # gunicorn bind = "0.0.0.0:" + uploadr.port diff --git a/uploadr.py b/uploadr.py index db783bf..180064c 100644 --- a/uploadr.py +++ b/uploadr.py @@ -44,7 +44,7 @@ def qrcodes(filename): image = qrcode.make(link) with open('qrcodes/' + filename+ '.png', mode = 'bw+') as file: image.save(file) - return send_from_directory('qrcodes', filename + '.png', as_attachment=True) + return send_from_directory(config.qrcodes, filename + '.png', as_attachment=True) @app.route('/qr/') def qr(filename=None): @@ -58,7 +58,7 @@ def qr(filename=None): @app.route('/download/') def download(filename=None): if filename != None: - return flask.send_from_directory('uploads', filename, as_attachment=True) + return flask.send_from_directory(config.uploads, filename, as_attachment=True) else: return hello()