File uploads in PHP
| From: | Dr. Evil | Date: | Fri, 17 Aug 2001 02:06:56 +0000 |
| Subject: | File uploads in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-63115@lists.php.net to get a copy of this message | ||
My PHP script needs to receive some files. I've seen sites which
accept them; they have a Browse button which lets the user select a
file to send. That's what I want to do.
I have a few questions about this. First of all, this is with
php4.06. Secondly, the files are all going to be images, and not very
large: no more than 50k.
What's the best way to do this? I notice that PHP can store these
files on disk, but I'm going to be storing them in a DB. I would
rather receive them directly into a PHP variable. Is this possible?
Or should I take them in a file, and then read them back in to a
variable?
Also, if they need to go into a file, which directory is safest for
this? /tmp contains some important files. And finally, how do I
limit the maximum file size that PHP will accept?
Thanks