从URL下载FTP阻止该网站

从URL下载FTP阻止该网站

问题描述:

I'm using this PHP code on a file to open a dialog box to download a video

header("Content-Type: video/mp4");
header("Content-Disposition: attachment; filename=full.mp4");
header("Content-Transfer-Encoding: binary");
readfile('ftp://login:pwd@exemple.com/video/2011/full.mp4');
exit;

Everything works fine except that during the download (150Mo video) I can not navigate on the web site. I have to wait for the download to complete (or to pause the download) to have the web site back for navigation ! (Even if I open a new tab and I try to open an URL on the web site)

Is there something that I'm doing wrong ?

I'm on a dedicated server.

Thanks for your help...

我在一个文件上使用这个PHP代码打开一个对话框来下载视频 p> \ n

  header(“Content-Type:video / mp4”); 
header(“Content-Disposition:attachment; filename = full.mp4”); 
header(“Content-Transfer-Encoding: 二进制“); 
readfile( '的ftp://登录:pwd@exemple.com/video/2011/full.mp4'); 
退出; 
 代码>  PRE> 
 
 

在下载期间(150Mo视频),一切正常除 strong>之外我无法在网站上导航。 我必须等待下载完成(或暂停下载)才能让网站返回导航! (即使我打开一个新选项卡,我也尝试在网站上打开一个URL) p>

我有什么问题吗? p> 我在专用服务器上。 p>

感谢您的帮助...... p> div>

PHP Does not support threads, it's single threaded, so you have to wait until the scripts finishes executing, in this case, until it finishes downloading that file to continue using your site. As a quick fix, you can host that file in other server, external to your site, and call that file from your site.