I use PHP to upload file to my server.I can't find my file in files folder.I suppose My code is right, but the file php.ini should be configured before uploading the file.Who can help me ? Here is my html code:
<form action="upload_file.php?act=put&name=use_resource" method="post" enctype="multipart/form-data">
<label for="file">PUT:</label>
<input type="file" name="file" id="file" />
<input type="submit" name="submit" value="Submit" />
</form>
My upload_file.php code is:
<?php
if ($_GET["act"] == "put")
{
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 />";
move_uploaded_file($_FILES["file"]["tmp_name"], "files/".$_FILES["file"]["name"]);
}
}