Issue with video upload

php

#1

Hi there !

I have some issue with uploading videos > 5MB with chunks :

For any APPEND I send, i got this error:
stdClass Object ( [request] => /1.1/media/upload.json [error] => segment size must be >= 1 java.nio.HeapByteBuffer[pos=64 lim=64 cap=66]. )

then for FINALIZE, I got:
stdClass Object ( [request] => /1.1/media/upload.json [error] => Segments do not add up to provided total file size. ) stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [code] => 324 [message] => Invalid media id 876826896708849664 ) ) )

But I’m sure the total bytes are well equal…

Does someone had the same issue ?


#2

Hey, no one had this issue before ? :frowning:


#3

I experienced that error when sending the entire contents of a chunked upload rather then splitting the chunks into 5MB.

You should do something like fread($fh, 5*1024*1024) to read in the file 5MB at a time.
Make sure you are sending it as multipart/form-data too.

I’m getting the Segments do not add up to provided total file size. error though which I haven’t figured out (yet).