note 59566 added to function.is-uploaded-file
| From: | greg at gbhumphrey dot com | Date: | Fri, 09 Dec 2005 20:10:25 +0000 |
| Subject: | note 59566 added to function.is-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99867@lists.php.net to get a copy of this message | ||
Hi
Im using php4 on a mac and wehen I test the file upload example html with isuploaded() function,-
the file is named isuploaded.php- like this:
<?php
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
echo "File ". $_FILES['userfile']['name'] ." uploaded
successfully.\n";
echo "Displaying contents\n";
readfile($_FILES['userfile']['tmp_name']);
} else {
echo "Possible file upload attack: ";
echo "filename '". $_FILES['userfile']['tmp_name'] .
"'.";
}
?>
I get an "error on line 3 of isuploaded.php" message!!
here's my html
<form enctype="multipart/form-data" action="isuploaded.php"
method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
Im following the examples on this website and it doesnt' work. I've checked my php.ini
file and the file upload is set to "On".
anyone have any ideas?
thanks
----
Manual Page -- http://www.php.net/manual/en/function.is-uploaded-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59566
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59566&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59566&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59566&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59566&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59566&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59566&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59566&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59566&report=yes
Search -- http://master.php.net/manage/user-notes.php