1
この質問では、ファイルをアップロードしたいのですが、ファイルをアップロードできません。この「警告:move_uploaded」が表示されています。 enter image description here エラースクリーンショットを添付しました。ファイルをアップロードできません警告:move_uploaded_file
This is my **uploadhtml.php** file
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
</form>
</body>
</html>
This is my **upload.php** file
<?php
if(!empty($_FILES['uploaded_file']))
{
$path = "uploads/";
$path = $path . basename($_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path))
{
echo "The file ". basename($_FILES['uploaded_file']['name']).
" has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
}
?>
ありがとうございます。$ path = "../uploads/"; – Kumar
素晴らしい、ハッピーコーディング:) – Thamaraiselvam
エラーを避けるために絶対を指定するのは常に良い – Thamaraiselvam