diff options
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/pogojig.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/webapp/pogojig.py b/webapp/pogojig.py index 9312cf5..16d4a51 100644 --- a/webapp/pogojig.py +++ b/webapp/pogojig.py @@ -93,15 +93,16 @@ def upload_svg(): flash(f'Error uploading SVG file: {"; ".join(msg for elem in upload_form.errors.values() for msg in elem)}', 'error') return redirect(url_for('jigerator')) -@app.route('/render/download/<file>') +@app.route('/render/download/<path:file>') def render_download(file): - if file not in ['jig.stl', 'pcb_shape.dxf', 'kicad.zip', 'sources.zip']: + if file not in ['jig.stl', 'pcb_shape.dxf', 'kicad.zip', 'sources.zip', + 'kicad/jig-cache.lib', 'kicad/jig.kicad_pcb', 'kicad/jig.pro', 'kicad/jig.sch']: abort(404) return send_file(tempfile_path(file), mimetype='application/zip', as_attachment=True, - attachment_filename=f'{path.splitext(session["filename"])[0]}_pogojig.zip') + attachment_filename=f'{path.splitext(session["filename"])[0]}_{path.basename(file)}') @app.route('/pogojig_template_empty.svg') def static_template(): |