Defect #11568
closedUploaded file name gets mangled when it contains a +
0%
Description
When uploading a file which names contains a "+", that character gets silently replaced by a space. I suppose this has to do with the parsing of the QUERY_STRING
, but it is annoying there as the + should remain verbatim in the name of the file offered for download through Redmine.
- Create a file with a '+' in its name (say, "a+b");
- Upload it in the files section of a Redmine project
- The file appears as "a b", and the download link leads to ".../a%20b"
While the file downloads correctly, it is inconvenient to have one's file renamed without control.
Files
Updated by Olivier Mehani over 12 years ago
Right, my experiment shows that I am not up to date. Is this a known bug that has already been addressed? I couldn't find it in the issues.
Updated by Etienne Massip over 12 years ago
- Category set to Attachments
- Status changed from New to Confirmed
- Target version set to Candidate for next minor release
Redmine.org is not running the latest version but demo is.
And indeed, it happens with trunk.
Updated by Jean-Philippe Lang over 12 years ago
Seems to be a Rails issue. The + is already replaced with a space in the original_filename
found in attachment params:
"attachments"=>{"1"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0x4c11fa8 @original_filename="test plus.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"attachments[1][file]\"; filename=\"test+plus.txt\"\r\nContent-Type: text/plain\r\n", @tempfile=#<File:xxx/RackMultipart20120814-2236-ogyxbd>>, "description"=>""}}
Updated by Jean-Baptiste Barth over 11 years ago
It works now fine on 2.3.1 and trunk, but confirmed broken on 2.2.4 and 2.1.6.
Relevant log on a fresh install:
redmine-2.2.4/log/development.log: Parameters: [...] "attachments"=>{"1"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0x007fcb8a55e5d0 @original_filename="a b.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"attachments[1][file]\"; filename=\"a+b.txt\"\r\nContent-Type: text/plain\r\n", @tempfile=#<File:/var/folders/2d/ym9f6qbd61x6_xxc51f17wq40000gn/T/ RackMultipart20130505-96276-1v561qz>>, "description"=>""}}, [...] redmine-2.3.1/log/development.log: Parameters: [...] "attachments"=>{"1"=>{"filename"=>"a+b.txt", "description"=>"", "token"=>"1.0d599f0ec05c3bda8c3b8a68c32a1b47"}} [...]
The fix is probably related to r10977 ?
Now that it works I think we need to add some tests to ensure it won't break again.
Updated by Go MAEDA over 9 years ago
Olivier Mehani wrote:
Steps to reproduce:
- Create a file with a '+' in its name (say, "a+b");
- Upload it in the files section of a Redmine project
- The file appears as "a b", and the download link leads to ".../a%20b"
While the file downloads correctly, it is inconvenient to have one's file renamed without control.
No problem on Redmine 3.0.0.
It seems that we can close this issue.
Updated by Toshi MARUYAMA over 4 years ago
- Status changed from Confirmed to Closed
- Target version deleted (
Candidate for next minor release)
No problem on Redmine 4.1.