From 2ecf6e250179cba562e82de8d75a2c8bc5ac2c50 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 25 Feb 2026 16:14:58 -0800 Subject: [PATCH] correct folder and image names in zip, correct zip file name --- app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 75309c8..f10f08e 100644 --- a/app.py +++ b/app.py @@ -34,6 +34,7 @@ def index(): 'NIV': 'niv', 'NLT': 'nlt' }.get(version) + filenameref = reference.replace(' ', '_').replace(':', '_') if bible_id and reference: webfriendlyref=reference.replace(' ','%20').replace(':','%3A') @@ -87,7 +88,7 @@ def index(): # You can now send png_bytes to a response or store it in a DB print(f"Page {page_index} is {len(png_bytes)} bytes.") - zf.writestr("SLIDES/{:04d}.png".format(page_index), png_bytes) + zf.writestr("{}/{}{:04d}.png".format(filenameref, filenameref, page_index), png_bytes) doc.close() @@ -100,7 +101,7 @@ def index(): memory_file, mimetype='application/zip', as_attachment=True, - download_name='downloaded_files.zip' # Use download_name for modern Flask versions + download_name='{}.zip'.format(filenameref) # Use download_name for modern Flask versions ) print(f"Reference: {reference}, Version: {version}, Text: {verse_text}, Error: {error}")