MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / _validate_chat_file_upload

Function _validate_chat_file_upload

Scripts/ButSystem.py:17291–17295  ·  view source on GitHub ↗

Validate a chat attachment (DM/group file/gif) and return (filename, mime).

(file_storage)

Source from the content-addressed store, hash-verified

17289 resp = Response(gen, mimetype=mime)
17290 resp.headers["Content-Disposition"] = f'attachment; filename="{filename}"'
17291 else:
17292 from flask import send_file
17293 resp = send_file(
17294 sp,
17295 mimetype=mime,
17296 as_attachment=True,
17297 download_name=filename,
17298 conditional=True,

Callers 5

_dm_store_fileFunction · 0.70
_dm_store_file_txFunction · 0.70
dm_sendFunction · 0.70
discussion_sendFunction · 0.70

Calls 1

_upload_filename_mimeFunction · 0.70

Tested by

no test coverage detected