update
This commit is contained in:
parent
40f6bb7953
commit
00ab98c9cc
|
|
@ -15,14 +15,17 @@
|
||||||
<main class="container">
|
<main class="container">
|
||||||
<form action="" method="post" enctype="multipart/form-data">
|
<form action="" method="post" enctype="multipart/form-data">
|
||||||
<input type="file" id="file-input" name="file" accept=".xls, .csv, .xlsx" required>
|
<input type="file" id="file-input" name="file" accept=".xls, .csv, .xlsx" required>
|
||||||
<p class="grid">
|
|
||||||
<label for="range">Velikost textu
|
|
||||||
</label>
|
|
||||||
<input type="range" min="0.5" max="10" value="1" step="0.5" id="range" name="range">
|
|
||||||
|
|
||||||
<label id="font_size">1</label>
|
<div class="grid">
|
||||||
</p>
|
<label for="range">Velikost textu
|
||||||
<!-- make submit possible only if file is choosen -->
|
</label>
|
||||||
|
<input type="range" min="0.5" max="10" value="1" step="0.5" id="range" name="range">
|
||||||
|
<label id="font_size">1</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label for="file-name">Název výstupního DXF</label>
|
||||||
|
<input type="text" id="file-name" name="output_file" placeholder="název výstupního DXF:" value="vystupni_body">
|
||||||
|
|
||||||
<input type="submit" id="submit-button" value="Nahrát a stáhnout hotový">
|
<input type="submit" id="submit-button" value="Nahrát a stáhnout hotový">
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
3
test.py
3
test.py
|
|
@ -15,6 +15,7 @@ def upload_file():
|
||||||
# Create a text file with the uploaded file name
|
# Create a text file with the uploaded file name
|
||||||
|
|
||||||
velikost = request.form['range']
|
velikost = request.form['range']
|
||||||
|
nazev_souboru = request.form['output_file']
|
||||||
print(velikost)
|
print(velikost)
|
||||||
|
|
||||||
body = nacti_data_z_excelu(file)
|
body = nacti_data_z_excelu(file)
|
||||||
|
|
@ -25,7 +26,7 @@ def upload_file():
|
||||||
return send_file(
|
return send_file(
|
||||||
path_or_file=dxf_file,
|
path_or_file=dxf_file,
|
||||||
as_attachment=True,
|
as_attachment=True,
|
||||||
download_name='hotovson.dxf',
|
download_name= nazev_souboru+".dxf" or 'hotovson.dxf',
|
||||||
mimetype='application/octet-stream'
|
mimetype='application/octet-stream'
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue