danog\MadelineProto\Settings\Files: File management settings.
Author: Daniil Gentili daniil@daniil.it
File management settings.
Method list:
getAllowAutomaticUpload(): boolsetAllowAutomaticUpload(bool $allowAutomaticUpload): \danog\MadelineProto\Settings\FilesgetUploadParallelChunks(): intsetUploadParallelChunks(int $uploadParallelChunks): \danog\MadelineProto\Settings\FilesgetDownloadParallelChunks(): intsetDownloadParallelChunks(int $downloadParallelChunks): \danog\MadelineProto\Settings\FilesgetResumeInterruptedCalls(): boolsetResumeInterruptedCalls(bool $resumeInterruptedCalls): \danog\MadelineProto\Settings\FilesgetSandboxDownloads(): boolsetSandboxDownloads(bool $sandboxDownloads): \danog\MadelineProto\Settings\FilesgetReportBrokenMedia(): boolsetReportBrokenMedia(bool $reportBrokenMedia): \danog\MadelineProto\Settings\FilesgetDownloadLink(): ?stringsetDownloadLink(?string $downloadLink): \danog\MadelineProto\Settings\Files
Methods:
getAllowAutomaticUpload(): bool
Get allow automatic upload of files from file paths present in constructors?
setAllowAutomaticUpload(bool $allowAutomaticUpload): \danog\MadelineProto\Settings\Files
Set allow automatic upload of files from file paths present in constructors?
Parameters:
$allowAutomaticUpload:boolAllow automatic upload of files from file paths present in constructors?
getUploadParallelChunks(): int
Get upload parallel chunk count.
setUploadParallelChunks(int $uploadParallelChunks): \danog\MadelineProto\Settings\Files
Set upload parallel chunk count.
Parameters:
$uploadParallelChunks:intUpload parallel chunk count
getDownloadParallelChunks(): int
Get download parallel chunk count.
setDownloadParallelChunks(int $downloadParallelChunks): \danog\MadelineProto\Settings\Files
Set download parallel chunk count.
Parameters:
$downloadParallelChunks:intDownload parallel chunk count
getResumeInterruptedCalls(): bool
Get whether to resume interrupted calls that upload files after a restart.
setResumeInterruptedCalls(bool $resumeInterruptedCalls): \danog\MadelineProto\Settings\Files
Set whether to resume interrupted calls that upload files after a restart.
If enabled, method calls and sendMedia calls (sendDocument, sendPhoto, …) uploading a file that survives a restart
(a local file, a URL, a Telegram file or a resumable stream) are saved in the session until they complete:
if the session is restarted in the meantime, the call is made again once the session starts, resuming the interrupted upload.
Disable it if your code already makes interrupted calls again after a restart, to avoid sending files twice.
Parameters:
$resumeInterruptedCalls:boolWhether to resume interrupted calls that upload files after a restart
getSandboxDownloads(): bool
Get whether files served to browsers can’t run as pages of the website serving them.
setSandboxDownloads(bool $sandboxDownloads): \danog\MadelineProto\Settings\Files
Set whether files served to browsers can’t run as pages of the website serving them.
Applies to the files served by the download script (getDownloadLink, downloadToBrowser) and by downloadToResponse:
their MIME type and name come from whoever sent them on Telegram, or from the query string of the download script.
If enabled, they’re served with a sandboxing Content-Security-Policy and X-Content-Type-Options: nosniff, with
their MIME type normalized, and only media and plain text are shown inline (everything else is downloaded).
Disable it only if the files served are trusted, and must be shown as pages of the website (HTML, SVG, PDF…).
Parameters:
$sandboxDownloads:boolWhether files served to browsers can’t run as pages of the website serving them
getReportBrokenMedia(): bool
Get whether to report undownloadable media to TSF.
setReportBrokenMedia(bool $reportBrokenMedia): \danog\MadelineProto\Settings\Files
Set whether to report undownloadable media to TSF.
Parameters:
$reportBrokenMedia:boolWhether to report undownloadable media to TSF
getDownloadLink(): ?string
Get custom download link URL for CLI bots, used by getDownloadLink.
setDownloadLink(?string $downloadLink): \danog\MadelineProto\Settings\Files
Only needed for CLI bots, not bots started via web.
Sets custom download link URL for CLI bots, used by getDownloadLink.
Can be null, in which case MadelineProto will automatically generate a download link.
Parameters:
$downloadLink:?stringCustom download link URL for CLI bots, used bygetDownloadLink.
Generated by danog/phpdoc