When setting 'Download Method' to private under "File System Settings" uploading a file with spaces in the file name works, however when you try to download the file it errors that it can not find it.

Setting it to public works fine with spaces in the filename. Also, changing the spaces to underscores in the file and uploading it like that shows that the spaces are the problem.

After the holiday weekend if noone checks into this I will.

Comments

Veggieryan’s picture

Im getting this too on 4.7.2... major bummer

jasoncd’s picture

I'm running 4.7.3 with php5 on IIS. I am not having this problem. I didn't have this problem with 4.6.x and php4 either.
HOWEVER... :)

I'm having a problem with Firefox where the downloaded file loses everything after the first space. I just 'fixed' this by doing the following using the following mozillazine guidance:
http://kb.mozillazine.org/Filenames_with_spaces_are_truncated_upon_download

upload.module - line 124

Change from:
'Content-Disposition: '. $disposition .'; filename='. $name
to:
'Content-Disposition: '. $disposition ."; filename=\"". $name ."\"");

Comments?

jonathan_hunt’s picture

I ran into this problem on Drupal 4.6.4. Here's the code I used. I think this is fixed on 4.7.6 because Content-Disposition is no longer sent by file_transfer().

Index: modules/upload.module
===================================================================
--- modules/upload.module       (revision 3046)
+++ modules/upload.module       (working copy)
@@ -195,7 +195,7 @@
         return array(
           'Content-Type: '. $type .'; name='. $name,
           'Content-Length: '. $file->filesize,
-          'Content-Disposition: '. $disposition .'; filename='. $name,
+          'Content-Disposition: '. $disposition .'; filename="'. $name.'"',
          'Expires: 0', 'Pragma: cache', 'Cache-Control: private'
         );
       }
c960657’s picture

Status: Active » Closed (duplicate)