需要一些关于多文件上传的帮助

时间:2013-01-25 08:49:20

标签: php mysql file-upload

我有这个代码

if(move_uploaded_file($_FILES['file1']['tmp_name'], $upload_directory . $filename)){
//http file
    $fullurl = $siteurl.'/'.$upload_directory.'/'.$filename;
    //insert db
    mysql_query("insert into up_guest(name,type,time,ip) values('$filename','$filetype',$time,'$ip')");
    print "<br><br>";
    print "فایل با موفقیت آپلود شد!";
    print "<br><br>";
    print "<font color='black'>Uploaded File is {$filename} and its size is {$_FILES['file1']['size']} bytes </font>";
}//file upload she
else{
    echo $_FILES['file1']['error'];
}

运行if和上传文件成功没有任何错误
ANDDDDDDDDDDDD也运行其他!!!
和文件错误是0!
有什么问题?

1 个答案:

答案 0 :(得分:1)

多文件上传阵列 move_uploaded_file($ _ FILES ['file1'] ['tmp_name'],$ upload_directory。$ filename)这不是缺少'/'

move_uploaded_file($_FILES['file1']['tmp_name'], $upload_directory .'/' . $filename)

我看到你使用'/'

有下一行代码