[plug] PostgreSQL & web page interface

Craig Ringer craig at postnewspapers.com.au
Thu Aug 22 21:06:27 WST 2002


> When you upload a file using an html form that is processed by PHP the 
> filesize may be limited.  Look for something like this in /etc/php.ini
> 
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 2M

You may also need to increase the max memory per PHP instance.

> $imagefile  -  this is the name of the file as stored in the temporary 
> directory on the server
> 
> $imagefile_name  -  name of the file as supplied from the user's machine
> 
> $imagefile_size  -  size of the file in bytes
> 
> $imagefile_type  -  the mime type (image/png, image/jpg, or whatever)

Umm... at least with PHP2 those are only defined if the non-default 
option to register globals is enabled. Otherwise its 
$_FILES['http_variable_name']['size'], ['name'], ['tmp_name'], ['type']

There's a handy PHP function that auto-moves temp files to a location of 
your chosing, and does some basic checking too. The function is called 
"move_uploaded_file".

Anyway I've also sent you a script, a bit of a different approach. Hope 
its of some use, though it could be commented better...



More information about the plug mailing list