NB: a minimum-viable-example exists here, with text copied from below.
We are unable to reliably upload images to Twitter.
If we upload an image in a single chunk, then the image uploads to Twitter without any problem. However, if we split the same image into multiple chunks, then Twitter may:
- refuse to upload the image, informing us that the
Segments do not add up to provided total file sizeonce the
FINALIZEcommand is called;
- accept the the image, but display a corrupted image in the tweet.
The error behavior varies based on the individual file used and the chunk size of our upload. However, we have not been able to determine any viable rules to guarantee success, and certain files seem to be more error prone than others.
Without the ability to introspect what OAuth.io is POSTing or what Twitter is receiving, we are unable to determine where the problem may be occurring.
The code to demonstrate this behavior is quite long (~200 lines of JS, not including the base64 images or HTML). I’ve published a full working example here for people to interact with. The code from the example available on Github.
Thanks in advance!