HTML_QuickForm and file upload rules

From: Date: Sun, 10 Oct 2004 00:22:05 +0000
Subject: HTML_QuickForm and file upload rules
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14829@lists.php.net to get a copy of this message
I don't know if it's been said before on the list and looking through the archive, I didn't see anything... If you are working with QuickForm and file uploads and you are registering rules for both "maxfilesize" and "uploadedfile" then you might be puzzled by some error occurences like I was. Let me see if I can explain this plainly. an important component is your php.ini setting for "upload_max_filesize". If this is smaller than your setting for "maxfilesize" then if you upload a file that is larger than the "upload_max_filesize" you will NEVER encounter the "maxfilesize" error you set for QuickForm. You will instead receive the "uploadedfile" error because, I'm guessing here, PHP is discarding the file that is too large and therefore QuickForm thinks there isn't a file. so if you register "maxfilesize" < "upload_max_filesize" and you're file upload is... < "maxfilesize" you'll successfully upload the file.
"maxfilesize" but < "upload_max_filesize" you'll see the maxfilesize error
but if you register "maxfilesize" > "upload_max_filesize" and you're file upload is...
"upload_max_filesize" but < "maxfilesize" you'll see the uploadedfile error
That may have been a little wordy. I've talked about this my blog with a chart if anyone is interested. <http://matte.silent-e.com/2004/10/pear-htmlquickform-and-file-upload.html> This could be fixed by QF checking the php.ini setting and adjusting the maxfilesize to reflect the ini setting if maxfilesize is larger or throwing a PHP error describing why. I'd prefer QF just change the setting itself, IMHO. Thoughts? Should I submit a bug on this? Though it's not really a bug, IMHO. -- matte - matte@arubanetworks.com webmonkey / arubanetworks.com / airheads04.com / wi-fi-it.com Get Firefox! <http://www.spreadfirefox.com/community/?q=affiliates&id=2885&t=85>

« previous php.pear.general (#14829) next »