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

时光总嘲笑我的痴心妄想 提交于 2019-12-03 14:19:27

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 - 832569344
795 - 07:14:16 - 833617920
796 - 07:14:17 - 834666496
797 - 07:14:18 - 835715072
798 - 07:14:19 - 836763648
799 - 07:14:19 - 837812224
800 - 07:14:20 - 838860800
801 - 07:14:21 - 839909376
802 - 07:14:22 - 840957952
803 - 07:14:23 - 842006528
804 - 07:14:24 - 843055104

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!