This commit is contained in:
navry 2025-08-05 06:21:01 +02:00
parent 40f6bb7953
commit 00ab98c9cc
2 changed files with 13 additions and 9 deletions

View File

@ -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">
<div class="grid">
<label for="range">Velikost textu <label for="range">Velikost textu
</label> </label>
<input type="range" min="0.5" max="10" value="1" step="0.5" id="range" name="range"> <input type="range" min="0.5" max="10" value="1" step="0.5" id="range" name="range">
<label id="font_size">1</label> <label id="font_size">1</label>
</p> </div>
<!-- make submit possible only if file is choosen -->
<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>

View File

@ -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: