Upgrade allow adding image in ticket details page comment section
This commit is contained in:
@@ -348,9 +348,15 @@ def download_attachment(att_id):
|
||||
f'user_id={current_user.id}'
|
||||
)
|
||||
abort(403)
|
||||
upload_dir = current_app.config['UPLOAD_FOLDER']
|
||||
return send_from_directory(upload_dir, att.stored_name, as_attachment=True,
|
||||
download_name=att.filename)
|
||||
upload_dir = current_app.config['UPLOAD_FOLDER']
|
||||
is_image = (att.mime_type or '').startswith('image/')
|
||||
return send_from_directory(
|
||||
upload_dir,
|
||||
att.stored_name,
|
||||
as_attachment = not is_image, # images render inline; other files force-download
|
||||
download_name = att.filename,
|
||||
mimetype = att.mime_type or None,
|
||||
)
|
||||
|
||||
|
||||
# ─── Notifications ────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user