Upload parameters
Optional
estimatedIf the file size is unknown, you can provide an estimate, which will be used to determine appropriate part size.
Upload file source.
Optional
fileFile MIME type. By default is automatically inferred from magic number
If MIME can't be inferred, it defaults to application/octet-stream
Optional
fileFile name for the uploaded file. Is usually inferred from path,
but should be provided for files sent as Buffer
or stream.
When file name can't be inferred, it falls back to "unnamed"
Optional
fileTotal file size. Automatically inferred for Buffer, File and local files.
Optional
partUpload part size (in KB).
By default, automatically selected by file size. Must not be bigger than 512 and must not be a fraction.
Optional
progressFunction that will be called after some part has been uploaded.
Number of bytes already uploaded
Total file size, if known
Optional
requestsNumber of parts to be sent in parallel per connection.
Optional
requireWhen using inputMediaUploadedPhoto
(e.g. when sending an uploaded photo) require
the file extension to be known beforehand.
This will make the library try to guess the file extension from the file mime type, or throw an error if it cannot be guessed.
Optional
requireWhen using inputMediaUploadedPhoto
(e.g. when sending an uploaded photo) require
the file size to be known beforehand.
In case this is set to true
, a stream is passed as file
and the file size is unknown,
the stream will be buffered in memory and the file size will be inferred from the buffer.
Upload a file to Telegram servers, without actually sending a message anywhere. Useful when an
InputFile
is required.This method is quite low-level, and you should use other methods like sendMedia that handle this under the hood.