我正在尝试做什么
问题
PHP
<?php
if(isset($_FILES['uploadfile'])){
$total_files = count($_FILES['uploadfile']['name']);
if( $total_files > 0){
for($i=0; $i<$total_files; $i++) {
$file_name = $_FILES['uploadfile']['name'][$i];
$file_size = $_FILES['uploadfile']['size'][$i];
$file_tmp = $_FILES['uploadfile']['tmp_name'][$i];
$file_type = $_FILES['uploadfile']['type'][$i];
$upload_Path = "storage/".$file_name;
if($file_size > 8000000){
echo ('Total upload size must be less than 8 MB.');
die;
}
if($file_tmp == ""){
$errors = 'There is no file path.';
die;
}
else{
if(!file_exists($upload_Path)){
move_uploaded_file($file_tmp, $upload_Path);
}
else{
$name = pathinfo($file_name, PATHINFO_FILENAME);
$ext = pathinfo($file_name, PATHINFO_EXTENSION);
$new_name = $name.rand().'.'.$ext;
$new_Path = "storage/".$new_name;
rename ($file_tmp, $new_Path);
move_uploaded_file($file_tmp, $new_Path);
}
}
}
}
}
?>
错误
警告:move_uploaded_file(C:\ wamp \ tmp \ php35CF.tmp):无法打开 stream:C:\ wamp \ www \ uploader \ mupld.php中没有此类文件或目录 第36行
警告:move_uploaded_file():无法移动 &#39; C:\瓦帕\ TMP \ php35CF.tmp&#39;到&#39; storage / instructions5361.txt&#39;在 第36行的C:\ wamp \ www \ uploader \ mupld.php