[dokuwiki] Re: Can't upload files anymore

Jerry Schwartz wrote:
My JavaScript isn't the best, and my knowledge of Dokuwiki's innards is
non-existent, but I found this in the source of the media manager screen:

      function G_onsubmithandler() {
          var filename = document.getElementById('upload__name').value;
           if(!filename){
            alert("Please enter a file for uploading");
            return false;
           }
           elems = filename.split(/\./);
           ext = elems.pop();
           if(!ext.match(/(jpeg|jpg|png|gif|bmp)/)) {
              alert('filetype not supported: ' + ext);
              return false;
           }
            setupFCK(document.getElementById('media__manager'));
            return true;
      }

Won't that prevent any file types but jpeg, jpg, png, gif, and bmp from
being accepted? I don't see where this code allows for reading mime.conf (no
You are using the media manager supplied by DokuWikiFCK, which restricts uploads to images. Just add the extension you want to permit for upload to the list of file types. For instance:

                  jpeg|jpg|png|gif|bmp|txt|gz


Or if you want to allow any type of file to be uploaded, delete the following:

         elems = filename.split(/\./);
          ext = elems.pop();
          if(!ext.match(/(jpeg|jpg|png|gif|bmp)/)) {
             alert('filetype not supported: ' + ext);
             return false;
          }

Or comment it out by placing it between comments markers as follows:
            /*

          elems = filename.split(/\./);
          ext = elems.pop();
          if(!ext.match(/(jpeg|jpg|png|gif|bmp)/)) {
             alert('filetype not supported: ' + ext);
             return false;
          }

             */

I'll look at this in the next release of DokuWikiFCK.

Thanks for bringing it to my attention,

Myron

--

_____________________
Myron Turner
http://www.mturner.org
http://net18reaching.org/cityscapes




--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: