dongzhun8449
2011-02-15 21:04下载大文件并在本地编写
which is the best way to download from php large files without consuming all server's memory?
I could do this (bad code):
$url='http://server/bigfile';
$cont = file_get_contents($url);
file_put_contents('./localfile',$cont);
This example loads entry remote file in $cont
and this could exceed memory limit.
Is there a safe function (maybe built-in) to do this (maybe stream_*)?
Thanks
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- springboot中如何播放本地视频?
- spring
- java
- 1个回答
- gradle build 编译生成的jar 包和源码不一致
- spring
- intellij-idea
- jar
- 3个回答
- Sql Server Management Studio如何连接到VisualStudio2017自带的数据库?
- sql
- visual studio
- 2个回答
- VS 编写的C#程序,在某些电脑上不能用,包括win7和win10
- c#
- visual studio
- 1个回答
- 怎样在java代码中调用执行shell脚本呀
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
换一换