[pmwiki-users] Upload Extension

Patrick R. Michaud pmichaud at pobox.com
Fri Mar 31 08:54:40 CST 2006

On Thu, Mar 30, 2006 at 11:48:06PM -0800, Gary Spivey wrote:
>    Is there a simple way to turn off the extension checking in the upload
>    module? I am tired of having to continually add new extensions and simply
>    want it to allow uploads of anything.

In local/config.php:

    if (strpos(@$_FILES['uploadfile'], '.')) {
      $ext = preg_replace('/^.*\\./', '', $_FILES['uploadfile']);
      $UploadExts[$ext] = 'application/octet-stream';

Whenever a file is uploaded, this customization dynamically adds
the file's extension into the list of approved extensions, thus
any file extension will be allowed.


More information about the pmwiki-users mailing list