note 8512 deleted from features.file-upload by yohgaki
| From: | yohgaki@php.net | Date: | Mon, 28 Jan 2002 10:20:04 +0000 |
| Subject: | note 8512 deleted from features.file-upload by yohgaki | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25899@lists.php.net to get a copy of this message | ||
Running RedHat 6.2 with PHP3 I ran into a little trouble with making this work. I used the
fragments in the chapter above and the windows post above but the final AH-HA came when I realized
that I needed to add 2 things to make it all work:
if (! $userfile) {
$error_msg = "No file specified or file outside guidelines.\n";
return;
}
This allowed me to catch files that were out of spec according to the HTML that actually sent the
file with TYPE=FILE. The kind of spec like INPUT TYPE="hidden"
name="MAX_FILE_SIZE" value="500000" and so on.
Also, I has to set permissions to the directory I was executing from and copying the temporary file
to with the command:
chmod o=rwx directoryname
I am sure there are better ways, but this worked great!