<?php
error_reporting(E_ALL);
include "func.php";
connectToDatabase("localhost","root","","test");
$fileName = $_FILES['name'];
$fileSize = $_FILES['size'];
$fileType = $_FILES['type'];
$fileTempName = $_FILES['temp_name'];
$uploaderID = $_SESSION['id'];
$date = date("d/m-Y");
$uploadDir = "avatarStor/";
$filePath = $uploadDir . $fileName;
if(!$fileName){
echo "Error: value 'fileName' was undefined<br>";
}
$result = move_uploaded_file($fileTempName, $filePath);
if (!$result) {
echo "Error: File could not be uploadet: ".$fileName;
exit;
}
if(!get_magic_quotes_gpc()){
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
}
$result = mysql_query("UPDATE users SET profilepicture='$fileName' WHERE id='$uploaderID'") or die(mysql_error());
?>
我无法move_uploaded_file();
在此上传脚本中。我继续和chmod 777
文件夹,但是,它失败了。PHP 在运行时不提供错误。