Skip to main content

upload.getCdnFile

Download a CDN file.

func (c *Client) UploadGetCDNFile(ctx context.Context, request *UploadGetCDNFileRequest) (UploadCDNFileClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.UploadGetCDNFile(ctx, &tg.UploadGetCDNFileRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UploadCDNFileClass
return nil
})

Parameters

NameTypeRequiredDescription
FileToken[]byteyesFile token
Offsetint64yesOffset of chunk to download
LimitintyesLength of chunk to download

Returns

UploadCDNFileClass

Possible errors

CodeTypeDescription
400FILE_TOKEN_INVALIDThe master DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile.
404METHOD_INVALIDThe specified method is invalid.

References