telegram api method · layer 229 · #be5335be

upload.getFile

usable by users and bots

Returns content of a whole file or its part.

definition

upload.getFile#be5335be flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:long limit:int = upload.File;

parameters

nametypedescription
flags#Flags, see TL conditional fields
preciseflags.0?trueDisable some checks on limit and offset values, useful for example to stream videos by keyframes
cdn_supportedflags.1?trueWhether the current client supports CDN downloads
locationInputFileLocationFile location
offsetlongNumber of bytes to be skipped
limitintNumber of bytes to be returned

returns

upload.File

errors (16)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400CDN_METHOD_INVALIDYou can't call this method in a CDN DC.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400FILE_ID_INVALIDThe provided file id is invalid.
400FILE_REFERENCE_EMPTYAn empty file reference was specified.
400FILE_REFERENCE_EXPIREDFile reference expired, it must be refetched as described in the documentation.
400FILE_REFERENCE_INVALIDThe specified file reference is invalid.
400LIMIT_INVALIDThe provided limit is invalid.
400LOCATION_INVALIDThe provided location is invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400OFFSET_INVALIDThe provided offset is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
406FILEREF_UPGRADE_NEEDEDThe client has to be updated in order to support file references.
420FLOOD_PREMIUM_WAIT_%dPlease wait %d seconds before repeating the action, or purchase a Telegram Premium subscription to remove this rate limit.

history

present in layers 2–229 · constructor id changed 2×

idlayers
#e3a6cfb52–103
#b15a9afc104–142
#be5335be143–229