Spaces:
Running
Running
Fix: Corretto errore PDF, keywords e barra di caricamento
Browse files
app.py
CHANGED
@@ -205,12 +205,11 @@ def download_report():
|
|
205 |
pdf.set_font("Arial", "I", 9)
|
206 |
pdf.cell(0, 10, "© 2025 NORUS Tool", 0, 0, "C")
|
207 |
|
208 |
-
# Salva il PDF
|
209 |
-
|
210 |
-
pdf.output(
|
211 |
-
pdf_output.seek(0) # Riavvolgi il file in memoria per l'invio
|
212 |
|
213 |
-
return send_file(
|
214 |
|
215 |
if __name__ == "__main__":
|
216 |
app.run(debug=True, host="0.0.0.0", port=7860)
|
|
|
205 |
pdf.set_font("Arial", "I", 9)
|
206 |
pdf.cell(0, 10, "© 2025 NORUS Tool", 0, 0, "C")
|
207 |
|
208 |
+
# Salva il PDF nella cartella uploads
|
209 |
+
output_path = os.path.join(app.config["UPLOAD_FOLDER"], "NORUS_Report.pdf")
|
210 |
+
pdf.output(output_path, 'F') # Salva il file sul disco
|
|
|
211 |
|
212 |
+
return send_file(output_path, as_attachment=True) # Forza il download del file PDF
|
213 |
|
214 |
if __name__ == "__main__":
|
215 |
app.run(debug=True, host="0.0.0.0", port=7860)
|