note 74808 added to features.file-upload
| From: | ChaosMixedakaChaosmixed at osu1 dot php dot net | Date: | Sat, 28 Apr 2007 00:22:50 +0000 |
| Subject: | note 74808 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125937@lists.php.net to get a copy of this message | ||
To people with IIS and php on a windows XP machine:
Php.ini:
upload_tmp_dir = "C:\Inetpub\wwwroot\upload_tmp\"
then create two folder in the wwwroot directory:
C:\Inetpub\wwwroot\upload
C:\Inetpub\wwwroot\upload_tmp
Make sure sharing, web sharing and ntfs security, is ok
------------------------
upload form
<html>
<body>
<form action="uploader.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:<label>
<input type="file" name="file" id="file" >
<br >
<input type="submit" name="submit" value="Submit" >
</form>
</body>
</html>
------------------------
the uploader
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_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 "Stored in: " . $_FILES["file"]["tmp_name"];
echo "<br>";
}
if (file_exists("/php/upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" .
$_FILES["file"]["name"];
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 68.45.35.242
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- https://master.php.net/note/edit/74808
Del: integrated -- https://master.php.net/note/delete/74808/integrated
Del: useless -- https://master.php.net/note/delete/74808/useless
Del: bad code -- https://master.php.net/note/delete/74808/bad+code
Del: spam -- https://master.php.net/note/delete/74808/spam
Del: non-english -- https://master.php.net/note/delete/74808/non-english
Del: in docs -- https://master.php.net/note/delete/74808/in+docs
Del: other reasons-- https://master.php.net/note/delete/74808
Reject -- https://master.php.net/note/reject/74808
Search -- https://master.php.net/manage/user-notes.php