Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/255.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在php复制过程中提供加载条_Php_Copy_Loading - Fatal编程技术网

如何在php复制过程中提供加载条

如何在php复制过程中提供加载条,php,copy,loading,Php,Copy,Loading,这是我的剧本: function copyr($source, $dest) { // Simple copy for a file if (is_file($source)) { return copy($source, $dest); } // Make destination directory if (!is_dir($dest)) { mkdir($dest); } // If the source is a symlink if (is

这是我的剧本:

function copyr($source, $dest) {
  // Simple copy for a file
  if (is_file($source)) {
    return copy($source, $dest);
  }
  // Make destination directory
  if (!is_dir($dest)) {
    mkdir($dest);
  }
  // If the source is a symlink
  if (is_link($source)) {
    $link_dest = readlink($source);
    return symlink($link_dest, $dest);
  }
  // Loop through the folder
  $dir = dir($source);
  while (false !== $entry = $dir -> read()) {
    // Skip pointers
    if ($entry == '.' || $entry == '..') {
      continue;
    }
    // Deep copy directories
    if ($dest !== "$source/$entry") {
      copyr("$source/$entry", "$dest/$entry");
    }
  }
  // Clean up
  $dir -> close();
  return true;
}
我这样调用函数:

<?php copyr("D:/ahmad","E:"); ?>
当我调用函数copyr时,总是加载很长的页面。
以及在复制过程中如何显示加载栏?

仅用php无法实现这一点。您可能可以使用类似uploadify的东西-谢谢,但我该如何使用它?uploadify应该有很好的文档记录。查看此页面,其中包括示例代码和视频演示: