Skip to content

Commit c06890d

Browse files
authored
Allow set different download folder
1 parent 134c75b commit c06890d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SlideServer.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
app.config['SECRET_KEY'] = os.urandom(24)
6262
app.config['ROI_FOLDER'] = "/images/roiDownload"
6363

64+
download_folder = os.getenv('DOWNLOAD_FOLDER', app.config['UPLOAD_FOLDER'])
65+
app.config['DOWNLOAD_FOLDER'] = download_folder
66+
6467
#creating a uploading folder if it doesn't exist
6568
if not os.path.exists(app.config['TEMP_FOLDER']):
6669
os.mkdir(app.config['TEMP_FOLDER'])
@@ -313,7 +316,7 @@ def getSlide(image_name):
313316
image_name = secure_relative_path(image_name)
314317
if not verify_extension(image_name):
315318
return flask.Response(json.dumps({"error": "Bad image type requested"}), status=400, mimetype='text/json')
316-
folder = app.config['UPLOAD_FOLDER']
319+
folder = app.config['DOWNLOAD_FOLDER']
317320
if os.sep in image_name:
318321
folder_and_file = image_name.rsplit(os.sep, 1)
319322
folder = os.path.join(folder, folder_and_file[0])

0 commit comments

Comments
 (0)