Skip to main content

upload.reuploadCdnFile

Request a reupload of a certain file to a CDN DC.

func (c *Client) UploadReuploadCDNFile(ctx context.Context, request *UploadReuploadCDNFileRequest) ([]FileHash, error)

Calling this method

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

res, err := api.UploadReuploadCDNFile(ctx, &tg.UploadReuploadCDNFileRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // []FileHash
return nil
})

Parameters

NameTypeRequiredDescription
FileToken[]byteyesFile token
RequestToken[]byteyesRequest token

Returns

[]FileHash

Possible errors

CodeTypeDescription
400CDN_METHOD_INVALIDYou can't call this method in a CDN DC.
500CDN_UPLOAD_TIMEOUTA server-side timeout occurred while reuploading the file to the CDN DC.
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.
400LOCATION_INVALIDThe provided location is invalid.
400REQUEST_TOKEN_INVALIDThe master DC did not accept the request_token from the CDN DC. Continue downloading the file from the master DC using upload.getFile.
400RSA_DECRYPT_FAILEDInternal RSA decryption failed.

References