Upload parameters
OptionalabortSignal?: AbortSignalOptionalestimatedSize?: numberIf the file size is unknown, you can provide an estimate, which will be used to determine appropriate part size.
Upload file source.
OptionalfileMime?: stringFile MIME type. By default is automatically inferred from magic number
If MIME can't be inferred, it defaults to application/octet-stream
OptionalfileName?: stringFile 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"
OptionalfileSize?: numberTotal file size. Automatically inferred for Buffer, File and local files.
OptionalpartSize?: numberUpload part size (in KB).
By default, automatically selected by file size. Must not be bigger than 512 and must not be a fraction.
OptionalprogressCallback?: (uploaded: number, total: number) => voidFunction that will be called after some part has been uploaded.
OptionalrequestsPerConnection?: numberNumber of parts to be sent in parallel per connection.
OptionalrequireExtension?: booleanWhen 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.
OptionalrequireFileSize?: booleanWhen 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
InputFileis required.This method is quite low-level, and you should use other methods like sendMedia that handle this under the hood.