[pmwiki-users] fix for attachments with spaces in the name

Frank Graffagnino frankie at graffagnino.net
Tue Jan 15 13:09:22 CST 2008


I'm using pmwiki-2.2.0-beta45, and noticed when downloading
attachments that have spaces in the name, the document would download,
but the header would not send down the entire name of the file (only
up to the first space).  This resulted in firefox showing the file
download/save as dialog, but the name of the file was lost after the
first space.  Not sure if it makes a different, but I have direct
download disabled.

I fixed this by editing "scripts/upload.php" and enclosing the
filename argument in the "Content-disposition" field to be enclosed in
quotes.  This seemed to fix the problem.

I changed:
   header("Content-disposition: $DownloadDisposition; filename=$upname");
to:
   header("Content-disposition: $DownloadDisposition; filename=\"$upname\"");

Just a heads up.  I think this will be a good change to make.

Also, I'm still having problems with downloading using Internet
Explorer and direct download disabled.  Internet Explorer doesn't like
something about the way the header is being transmitted.  Anyone
successfully downloading files using Internet Explorer with direct
download off?

FG



More information about the pmwiki-users mailing list