Skip to content

Instantly share code, notes, and snippets.

@exileed
Created November 16, 2016 04:30
Show Gist options
  • Save exileed/824c3ca85143ec1e0011d60a22c51a6b to your computer and use it in GitHub Desktop.
Save exileed/824c3ca85143ec1e0011d60a22c51a6b to your computer and use it in GitHub Desktop.
$bytesCopied = stream_copy_to_stream($source, $target);
fclose($source);
fclose($target);
unset($source, $target);
if (!is_file($targetFile)) {
throw new Exception('');
}
if($bytesCopied !== filesize($originFile)){
throw new Exception('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment