korchix
korchix

Reputation: 1700

googleapiclient.errors.MediaUploadSizeError: Media larger than 26214400

i'm using the Google-api-python-client to upload some emails to a google groups. the upload works fine until i got this error while uploading... .

File "/Users/xxxxx/Downloads/pythonClientLibrary/google-api-python-client-1.8.3/googleapiclient/discovery.py", line 861, in method
    raise MediaUploadSizeError("Media larger than: %s" % maxSize) googleapiclient.errors.MediaUploadSizeError: Media larger than: 26214400

is there any way to change/increase the value of the 'maxSize' variable to be able to upload mails with size larger than 26mb ?

Upvotes: 0

Views: 299

Answers (1)

korchix
korchix

Reputation: 1700

apparently 25MB is the max size of a message, that is allowed to be transferred using the Groups Migration API

so in my code, i checked if the msg size is > 25mb then ignore this msg.

 message_size = msg.as_string().__sizeof__()
if message_size >= 26214400:
    print('Message {} - Size {} - subject : {} - from: {} - to: {}'.format(i, message_size, msg['subject'], msg['from'], msg['to']))
    continue

Upvotes: 0

Related Questions