1

I am uploading an attachment of type video which is around 17MB but somehow facebook is saying it's exceeding the filesize allowed which is 25 MB.

I am getting the following error while trying to upload the video

(#100) Attachment size exceeds allowable limit. Depending on the file, encoding can increase the size of the uploaded file. Please upload the file in chunks to avoid hitting the max file size.

I have even tried uploading it via curl

curl  \
  -F 'message={"attachment":{"type":"video", "payload":{"is_reusable":true}}}' \
  -F 'filedata=@"/home/deepak/Downloads/file.mp4";type=video/mp4' \
  "https://graph.facebook.com/v5.0/1052xxxxxxx/message_attachments?access_token=EAxxxxxxxxxxxxxxxxxxl"

I am getting the following error:

{
  "error": {
    "message": "(#100) Upload attachment failure.",
    "type": "OAuthException",
    "code": 100,
    "error_subcode": 2018047,
    "fbtrace_id": "xxxxxxxxxxx"
  }
}
Deepak Mahakale
  • 22,834
  • 10
  • 68
  • 88
  • This is not necessarily about the size of your input file. The error message said it already (_“Depending on the file, encoding can increase the size of the uploaded file.”_), https://developers.facebook.com/docs/messenger-platform/send-messages#sending_attachments explicitly mentions it again: _“Please note that our servers might encode an uploaded file to ensure compatibility. It's possible to get a file size limit error if the resulting size surpasses the 25MB limit.”_ – 04FS Feb 03 '20 at 11:09
  • So is there a way to avoid this? or should I encode the file myself to compatible video format? – Deepak Mahakale Feb 03 '20 at 11:18
  • BTW It is .mp4 right now – Deepak Mahakale Feb 03 '20 at 11:18
  • @04FS any idea on this – Deepak Mahakale Feb 03 '20 at 11:28
  • _“Please upload the file in chunks to avoid hitting the max file size.”_ - that not an option? – 04FS Feb 03 '20 at 11:32
  • I don’t know what formats Facebook encodes to, I am not sure if they provide any specific lists for that. It’s probably still going to be mp4 for the majority of users, but with specific parameters. – 04FS Feb 03 '20 at 11:33
  • I am uploading it for messenger using the attachment api I think the chunk option is only for page videos – Deepak Mahakale Feb 03 '20 at 11:33
  • Ah, okay; I don’t know if chunked upload is actually a thing for messenger attachments, I would have just assumed because the error message mentioned that as an alternative. – 04FS Feb 03 '20 at 11:37
  • According to https://developers.facebook.com/docs/messenger-platform/reference/attachment-upload-api , subcode=2018047 is ."a common way to trigger this error is that the provided media type does not match type of file provided int the URL" In my case, it was an .jpeg extension in the URL, which i had to rename to .jpg to get the API working, so backend might be strict on acceptable extensions. In your case I would probably try renaming file in the URI to .mpg, mpeg extensions maybe? – Balazs David Molnar Sep 17 '20 at 20:25

0 Answers0