RE: [PHP-WIN] File upload
| From: | Christian Sandfeld | Date: | Mon, 03 Dec 2001 10:06:11 +0000 |
| Subject: | RE: [PHP-WIN] File upload | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-10696@lists.php.net to get a copy of this message | ||
Without knowing for sure I would imagine that the PHP installation on the
server is running in safe mode (look for the "safe_mode" var in your
php.ini).
Brgds,
Christian
-----Original Message-----
From: Samba Sidibeh [mailto:samba.sidibeh@systeam.se]
Sent: 3. december 2001 10:50
To: php-windows@lists.php.net
Subject: [PHP-WIN] File upload
Hi
I'm trying to learn how to do file upload and I am using the example shown
on php.net's manual (http://www.php.net/manual/en/features.file-upload.php):
<form enctype="multipart/form-data" action="_URL_"
method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
...for the client
and:
<?php
if (is_uploaded_file($userfile)) {
copy($userfile, "/place/to/put/uploaded/file");
} else {
echo "Possible file upload attack: filename '$userfile'.";
}
/* ...or... */
move_uploaded_file($userfile, "/place/to/put/uploaded/file");
?>
..for the server side. No matter how I do it I always get the response
"Possible file upload attack: filename." from the server. Am I forgetting
something or what. Any help at all would make me very glad.
------------------------
Samba Sidibeh
Systemutvecklare
SYSteam Udac AB
Storgatan 19, Box 174, 751 04 Uppsala
Tel direkt: 018-67 81 35
Tel vxl: 018-67 80 00 Fax: 018-51 66 00
Hemsida: www.systeam.se, www.udac.se
SYSteam Udac ingår i SYSteamkoncernen.