Re: NewBie-UPLOADING IMAGE
| From: | Evan | Date: | Sun, 26 May 2002 16:06:44 +0000 |
| Subject: | Re: NewBie-UPLOADING IMAGE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99300@lists.php.net to get a copy of this message | ||
This works for me (WinXPpro, IIS, PHP 4.1.2):
<?php
if (isset($HTTP_POST_VARS["MAX_FILE_SIZE"]))
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
copy($HTTP_POST_FILES['userfile']['tmp_name'],
"upload/".$HTTP_POST_FILES['userfile']['name']);
move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],
"upload/".$HTTP_POST_FILES['userfile']['name']);
} else {
echo "Possible file upload attack. Filename: " .
$HTTP_POST_FILES['userfile']['name'];
}
?>
Hope it will help
bye,
evan
"Dani" <universal2001@iprimus.com.au> ha scritto nel messaggio
news:3CF016EF.7FD24684@iprimus.com.au...
> Hi,
>
> I want to upload image file into a folder in webserver using HTML form.
> What function do I use fo this purpose?
>
> Thank you,
>
> Dani
>