mabil commited on
Commit
eec4de5
·
1 Parent(s): 474cb5c

Fix: Corretto errore PDF, keywords e barra di caricamento

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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 in memoria
209
- pdf_output = BytesIO()
210
- pdf.output(pdf_output, 'F')
211
- pdf_output.seek(0) # Riavvolgi il file in memoria per l'invio
212
 
213
- return send_file(pdf_output, as_attachment=True, download_name="NORUS_Report.pdf")
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)