1

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?

utdev
  • 3,942
  • 8
  • 40
  • 70
  • 3
    Maybe this is usefull? http://stackoverflow.com/questions/6564643/copy-large-files-over-2-gb-in-php In this it's suggested chunk it up. – Michael Jan 11 '17 at 12:57
  • 4
    Possible duplicate of [Copy large files (over 2 GB) in PHP](http://stackoverflow.com/questions/6564643/copy-large-files-over-2-gb-in-php) – Alive to die - Anant Jan 11 '17 at 12:58

1 Answers1

0

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.

utdev
  • 3,942
  • 8
  • 40
  • 70