Php copy only copies part of file

走远了吗. 提交于 2021-01-29 03:27:11

问题


I am trying to copy a video file which has a size of 5Gbs.

I use this simple line:

copy($in, $out);

But somehow the copied file has only a size of ~700 Mb.

Is there a limit which the copy function has.

Are there some other ways to copy files using php?


回答1:


Ok I think I found a solution, I did following:

exec('copy ' $in . ' ' . $out);

This copied the whole file properly.

I am not sure why exactly this works.

My wild guess would be that copy() copies files immediately even if there a some changes and the command probably waits until there are no changes.



来源:https://stackoverflow.com/questions/41591247/php-copy-only-copies-part-of-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!