How to upload Video to YouTube using Google API PHP Client Library and Youtube API V3? How to upload Video to YouTube using Google API PHP Client Library and Youtube API V3? php php

How to upload Video to YouTube using Google API PHP Client Library and Youtube API V3?


Strangely a very small tweak in code fixes the problem.

Instead of just $videoPath = "/path/to/file.mp4"; using DOCUMENT_ROOT solves the issue. Other than that code of documentation is perfect.

$videoPath = $_SERVER["DOCUMENT_ROOT"] . "/mapapp/videos/test.mp4";


for other whoe comes around and deal with "Failed to parse Content-Range header"

I was searching for 3 days and finaly i found my solution...

my file was bigger then 4gb and xampp on windows (my webserver tool) is just 32bit so the fopen() command could not read my big files.

I installaed apache 64bit and php7 64bit by my own and it is gone

At this moment my script finaly loads chunks on big files

794 - 07:14:15 - 832569344795 - 07:14:16 - 833617920796 - 07:14:17 - 834666496797 - 07:14:18 - 835715072798 - 07:14:19 - 836763648799 - 07:14:19 - 837812224800 - 07:14:20 - 838860800801 - 07:14:21 - 839909376802 - 07:14:22 - 840957952803 - 07:14:23 - 842006528804 - 07:14:24 - 843055104

allready 804 chunks ^^ no truncate nothign :D just uploading flawless