summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2019-09-29 13:40:05 +0200
committerjaseg <git@jaseg.net>2019-09-29 13:40:05 +0200
commit87ed5a55d4231ae711d17b69808ffd94ae443fa2 (patch)
tree806b10833c3f2426162181a5415c121fc1bf88c4
parent00380ac6020179de15929afc1b29b7dc5ce094e4 (diff)
downloadpogojig-87ed5a55d4231ae711d17b69808ffd94ae443fa2.tar.gz
pogojig-87ed5a55d4231ae711d17b69808ffd94ae443fa2.tar.bz2
pogojig-87ed5a55d4231ae711d17b69808ffd94ae443fa2.zip
Add raw kicad file download
-rw-r--r--webapp/pogojig.py7
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():