Upload Video Media Type Unrecognized Error #54
Unanswered
theharunuysal
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am successfully uploading a jpeg image via the API, but when I want to upload a video, I get the Uncaught RuntimeException: {"request":"/1.1/media/upload.json","error":"media type unrecognized."} error. How can I upload a video?
$file = 'video.mp4'; $file_data = base64_encode(file_get_contents($file)); $media_info = $client->uploadMedia()->upload($file_data); $return = $client->tweet()->create() ->performRequest([ 'text' => 'Test Tweet... ', "media" => [ "media_ids" => [ (string)$media_info["media_id"] ] ] ]) ;
Beta Was this translation helpful? Give feedback.
All reactions