Php 从URL导入视频并直接传递给访问者进行下载
我面临的问题是,我们正在共享主机系统上链接一个.mp4文件,但我们希望该链接可以作为下载链接使用。我们使用链接中的Php 从URL导入视频并直接传递给访问者进行下载,php,file,curl,video,import,Php,File,Curl,Video,Import,我面临的问题是,我们正在共享主机系统上链接一个.mp4文件,但我们希望该链接可以作为下载链接使用。我们使用链接中的download属性执行此操作: <a href="https://another-hosting.org/video.mp4" download> 有人能告诉我应该考虑哪一个PHP函数集吗?谢谢 在你的下载video.php中试试这个,也许吧 <?php $vidFile=$_GET["file"]; $videoURL = "https://another
download
属性执行此操作:
<a href="https://another-hosting.org/video.mp4" download>
有人能告诉我应该考虑哪一个PHP函数集吗?谢谢 在你的
下载video.php中试试这个,也许吧
<?php
$vidFile=$_GET["file"];
$videoURL = "https://another-hosting.org/$vidFile";
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=video.mp4");
header("Content-Type: video/mp4");
readfile($videoURL);
太棒了!这正是我想要的!:-)工作起来很有魅力!
<?php
$vidFile=$_GET["file"];
$videoURL = "https://another-hosting.org/$vidFile";
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=video.mp4");
header("Content-Type: video/mp4");
readfile($videoURL);