Skip to content
Advertisement

Download .mp4 from URL using Laravel

How to download .m4v video from given URL with Laravel? I have a URL for example rtmp://123456.r.cdnsun.net/_definst_/mp4:123456/h264/123456.m4v … Can you recommend me a package for Laravel which could make the process easier?

Advertisement

Answer

It depends on what exactly you’re trying to achieve. For example, if you want to just copy file from a remote server, you could use copy():

$remoteFile = 'rtmp://123456.r.cdnsun.net/_definst_/mp4:123456/h264/123456.m4v';
$localFile = storage_path().'movies';
copy($remoteFile, $localFile);
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement