$size = $_FILES['myFile']['size']; $error = $_FILES['myFile']['error']; $type = $_FILES['myFile']['type']; $name = $_FILES['myFile']['name']; $tmp_name = $_FILES['myFile']['tmp_name']; $filename =& $tmp_name; copy($filename, 'uploads/'.'copy'.$name); move_uploaded_file($filename, 'uploads/'.'move'.$name);
如果先执行move,就会报错,copy说它找不到那个文件。(文件已经被move移走了,它肯定找不到);
如果先执行copy,就不会报错,uploads文件夹内会出现两个文件。(copy只是复制,原文件还在,所以move还有的做)。
现在,我想问,如果是用copy, 那临时文件什么时候释放呢?