如何在PHP Shell脚本中显示文件下载进度? [英] How to show file download progress in PHP Shell Scripting?
本文介绍了如何在PHP Shell脚本中显示文件下载进度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢!
解决方案
p>这似乎工作(意外!)
echowget'$ feedURL'\\\
;
$ execute =wget -O。$ filePath。'$ feedURL'\\\
;
$ systemOutput = shell_exec($ execute);
$ systemOutput = str_replace(\\\
,\\\
\t,$ systemOutput);
echo\t $ systemOutput\\\
;
I have a php shell script that downloads a large file, it would be a bit of a luxury to be able to see the progress of the download in shell while it's happening, anyone have any idea how this can be achieved (or at least point me in the right direction!)
Thanks!
解决方案
This seemed to work (unexpectedly!)
echo "wget '$feedURL'\n";
$execute = "wget -O ".$filePath." '$feedURL'\n";
$systemOutput = shell_exec($execute);
$systemOutput = str_replace( "\n", "\n\t", $systemOutput);
echo "\t$systemOutput\n";
这篇关于如何在PHP Shell脚本中显示文件下载进度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文