[dokuwiki] Re: Problem uploading files

  • From: Julio Biason <julio.biason@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 23 Dec 2005 13:34:28 -0200

On 23/12/05, Chris Smith <chris@xxxxxxxxxxxxx> wrote:
> Does dokuwiki get to see the name the file had on the client machine?
> The $_FILES data only includes one file name from the client, 'name',
> and that is what dokuwiki uses.

Ok, maybe I got a little bit lost here, but I tried to upload another
file, removing the extension again and adding some output while
uploading. I got the following from $_FILES (printing key/value):

name = bzr-0.6.2.tar.gz
type = application/x-gzip
tmp_name = /tmp/phpTPJTEB
error = 0
size = 519926

(Just a note: the id/wikiname used was "bzr-0.6.2")

So, yeah, $_FILES['name'] really got the real name. The problem seems
to be the code around line 113, where DokuWiki uses the 'id' as
filename instead of $_FILES['name']. If you leave it blank, the PHP
will use the name as id and work.

If I'm not mistaken, the solution is just change

  $fn   = mediaFN($id);

to

  $fn   = mediaFN($_FILES["name"]);

--
Julio Biason <julio.biason@xxxxxxxxx>
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: