mohsin-devs commited on
Commit
f492244
·
1 Parent(s): a158e71

Allow inline file previews by changing download attachment header

Browse files
Files changed (1) hide show
  1. server/routes/api.py +1 -1
server/routes/api.py CHANGED
@@ -211,7 +211,7 @@ def download_file(file_path):
211
  if not os.path.exists(safe_path) or not os.path.isfile(safe_path):
212
  return jsonify({"success": False, "error": "File not found"}), 404
213
 
214
- return send_file(safe_path, as_attachment=True)
215
 
216
  except Exception as e:
217
  logger.error(f"Error in download_file: {str(e)}")
 
211
  if not os.path.exists(safe_path) or not os.path.isfile(safe_path):
212
  return jsonify({"success": False, "error": "File not found"}), 404
213
 
214
+ return send_file(safe_path, as_attachment=False)
215
 
216
  except Exception as e:
217
  logger.error(f"Error in download_file: {str(e)}")