[geeklog-modules] Using the GL upload.class library with multiple images

Blaine Lang langmail at sympatico.ca
Tue Jan 28 20:57:11 EST 2003


Tony,

I'm trying to use your upload class with a form that has multiple file type
input fields. I have logging in the class and am getting the following
output. I am testing with small files

ERRORS
File, Array, is bigger than the 20480 byte limit
Mime type, Array, not in list of allowed mime types

Since HTTP_POST_FILES is now an array of arrays
- using $curfile = current($HTTP_POST_FILES) - will return an array, so I
have tried some tests of referencing element 0 which from my debug output is
the real file name.

$pos = strrpos($curfile['name'][0],'.') + 1;
$fextension = substr($curfile['name'][0], $pos);
$filename = $_USER['username'] . '.' . $fextension;
$upload->setFileNames($filename);
$upload->setPerms('0644');
$upload->setMaxFileSize(20480); //20KB
reset($HTTP_POST_FILES);
$upload->uploadFiles();

Any tips?

Blaine




More information about the geeklog-modules mailing list