[pmwiki-users] need help making big uploads work

Neil Herber nospam at mail.eton.ca
Wed Feb 23 15:49:15 CST 2005


At 2005-02-23  09:31 AM -0600, Patrick R. Michaud is rumored to have said:
>Interesting, I'm surprised that PHP watches time limits on uploads.
>However, I don't think there's any real downside to raising the time
>limits.  Try
>
>     ini_set('max_execution_time', '300');
>     ini_set('max_input_time', '300');
>
>in config.php and see if it allows larger uploads.  You may be able
>to raise the time limit just for uploads via:
>
>     if ($action == 'postupload') {
>       ini_set('max_execution_time', '300');
>       ini_set('max_input_time', '300');
>     }
>
>If these don't work, you may need to change the settings in a PHP
>initialization file somewhere.

Unfortunately, the conditional raising of the time limit did not work - I 
had to change the values in php.ini and restart Apache.

That worked, but it exposed an oddity in the upload form. The user was 
uploading a file called "My massive document.pdf" and he chose to rename it 
"My document". The upload started and appeared to complete, but then failed 
claiming that the file was bigger than the 50,000 byte limit - but I had 
set the limit for PDFs to 8 megs.

It appears that PmWiki looks at the name the file is given rather than the 
source name when deciding on the size limit. When the user set the name to 
"My document.pdf" everything worked fine.

On Windoze boxes, it is possible to suppress the display of file 
extensions, and that was the case for this user. He was not even aware of 
the extension of the file he was uploading.

Given that the extension is used to decide on the legality of the file type 
and its size limit, should the upload processor not insist on a proper 
extension before starting the upload?


Neil

Neil Herber
Corporate info at http://www.eton.ca/
Eton Systems, 15 Pinepoint Drive, Nepean, ON, Canada K2H 6B1
Tel: (613) 829-4668 




More information about the pmwiki-users mailing list