[Pmwiki-users] can't get uploads working

Patrick R. Michaud pmichaud
Sun Dec 19 10:50:28 CST 2004


On Sun, Dec 19, 2004 at 10:54:49AM +0000, Ciaran wrote:
> 
> In terms of file size limitation I ran into a problem the other week
> when the file was greater than 5Meg.  The errors PmWiki gave me did
> *not* suggest this was to do with file length.  I just got 'no file
> uploaded'.  [...]
> Pm: Is it possible to detect that a file couldn't be uploaded due to
> being too big or is this restriction hidden from php?

There are several systems that can block an upload as being too big.
PmWiki's ability to detect a blocked upload depends on what PHP reports
to PmWiki...

1.  The upload can be blocked by PmWiki as being too large for its
    type (as determined by $UploadExtSize, which defaults to $UploadMaxSize
    if not set).  In this case, PmWiki returns with an error message like
    "file is larger than maximum of NNN bytes for 'XYZ' files".

2.  The upload can be blocked by PHP based on the upload_max_size
    ini-setting.  In this case PmWiki is supposed to report back with
    "file is larger than maximum allowed by webserver", but I just found
    a bug in 2.0.beta10 that has been causing PmWiki to report 
    "no file uploaded" instead.  This will be fixed for 2.0.beta11 
    later today.

3.  The upload can be blocked by PHP based on the post_max_size
    ini-setting.  In this case PHP appears to strip all of the
    information from the POST request (including the ?action=upload), 
    so that PmWiki sees it as a simple browse request.  Arguably this
    is a PHP shortcoming -- PHP ought to do something a bit more
    intelligent than just silently remove the POST data.

4.  The upload can be blocked by the webserver itself as being too large.  
    In Apache this is controlled by the LimitRequestBody directive,
    and typically results in the webserver returning a "413 Request
    Body Too Large" error.  Again, PmWiki doesn't ever see the result
    of the upload request in this case, because it's intercepted by the
    webserver itself.

So, some file upload errors PmWiki can catch, and some it can't.  It all
depends on the webserver + PHP settings.

Pm



More information about the pmwiki-users mailing list