0
困難我已經做了php
代碼上傳文件....它上傳它成功地......但我怎麼phsicaly去看看它在哪裏......?找到上傳文件目錄
注:我越來越無法從move_uploaded_file()
這裏輸出是我的代碼:
<?php
$allowedExts = array("c", "cpp", "py", "java");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp);
if (($_FILES["file"]["size"] < 100000) && in_array($extension, $allowedExts))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"]/1024) . " kB<br>";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";
if (file_exists("upload/" . $_FILES["file"]["name"])) {
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
mkdir ("./upload");
if (move_uploaded_file($_FILES["file"]["tmp_name"],"./upload/" . $_FILES["file"]["name"]))
{
echo "sucess";
}
else
{
echo "fail";
}
}
}
}
else
{
echo "Invalid file";
}
?>
ya我收到一個錯誤...現在我該怎麼辦..? – PRP 2014-09-19 18:00:41
所以使目錄可寫 – 2014-09-19 18:03:15
在哪個文件夾 – PRP 2014-09-19 18:03:34