Large file can not be finalized synchronously


#1

What are possible reasons for the error message: “Large file can not be finalized synchronously” ?

The video I try to upload is 16.2 MB and the duration is 45 sec. The PHP script uses async chunked upload which should be able to handle files up to 512 MB according to documentation: https://dev.twitter.com/rest/media/uploading-media

I have successfully uploaded (small) test videos with this script.


#2

Large files need to be uploaded in chunks. The error message suggests that you’re doing in one go? Can you share a code snippet?


#3

Hi Andy,

the upload was in chunks - so that wasn’t the problem. I found the solution:

I had to set the parameter ‘media_category’ to ‘tweet_video’.

Please update the documentation on https://dev.twitter.com/rest/reference/post/media/upload-init

currently it only says:

media_category
required: sometimes
A string enum value which identifies a media usecase. This identifier is used to enforce usecase specific constraints (e.g. filesize, video duration) and enable advanced features.

Please add specific information about this parameter!


#4

Thanks for the feedback, I’ll see what we can do to improve that!