Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#4837 closed defect (worksforme)

Unable to download attachments containing spaces in their filename

Reported by: michael@… Owned by: Jonas Borgström
Priority: low Milestone:
Component: ticket system Version: 0.10.3
Severity: normal Keywords: attachment
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

As discussed on #trac, we're currently unable to download attachments which contain spaces (and possibly other CGI escaped chars). For example:

Ticket URL:

http://dev.rubyonrails.org/ticket/6175

Attachment URL:

http://dev.rubyonrails.org/attachment/ticket/6175/6175_flash_update_and_filter_chain+tests_r5270.diff

Contents of the directory:

$ gls /home/dev.rubyonrails.org/tracs/rails/attachments/ticket/6175/                                                                 
6175_flash_update_and_filter_chain%2Btests_r5270.diff  6175_flash_update_etc.diff         actionpack_test_sweep_after_halted_filter_chain.diff
6175_flash_update_and_filter_chain%2Btests.diff        actionpack_test_flash_update.diff  sweep_flash_in_before_filters_v2.diff

Files without 'special' chars in their names are working fine.

Attachments (0)

Change History (6)

comment:1 by Alec Thomas, 18 years ago

I'm not able to replicate this on 0.10.3…

Attachment directory:

[aat@stalactite:~/projects/trac/stable]ls -l ../env/stable/attachments/ticket/1
total 16
-rwxr-xr-x 1 aat eng    5 Feb 25 15:29 alec%20thomas.txt*
-rwxr-xr-x 1 aat eng    5 Feb 25 15:29 alec%2Bthomas.txt*

Can you check your Trac database has the correct filenames?

Mine are:

sqlite> select * from attachment where id='1';
ticket|1|alec thomas.txt|5|1172377761|Testing testing|athomas|127.0.0.1
ticket|1|alec+thomas.txt|5|1172377781|Testing testing|athomas|127.0.0.1

comment:2 by michael@…, 18 years ago

  type  |  id  |                       filename                       | size |    time    |          description          | author |     ipnr      
--------+------+------------------------------------------------------+------+------------+-------------------------------+--------+---------------
 ticket | 6175 | sweep_flash_in_before_filters_v2.diff                | 1561 | 1158043880 | patch                         | caio   | 201.52.81.228
 ticket | 6175 | actionpack_test_flash_update.diff                    | 1249 | 1158072982 | tests for the silly flash bug | caio   | 201.52.81.228
 ticket | 6175 | actionpack_test_sweep_after_halted_filter_chain.diff | 1387 | 1158076025 | test                          | caio   | 201.52.81.228
 ticket | 6175 | 6175_flash_update_and_filter_chain+tests.diff        | 3976 | 1158076185 | all together now              | caio   | 201.52.81.228
 ticket | 6175 | 6175_flash_update_and_filter_chain+tests_r5270.diff  | 5296 | 1160380486 | revised patch                 | caio   | 201.52.51.50
 ticket | 6175 | 6175_flash_update_etc.diff                           | 5331 | 1172363694 | Reattachment of ghost patch.  | nzkoz  | 10.71.165.102

That's the dump from the relevant ticket, it appears correct to me.

comment:3 by Alec Thomas, 18 years ago

Can you enable debug logging and check for lines like this:

2007-02-25 16:19:44,599 Trac[attachment] DEBUG: Trying to open attachment at ../env/stable/attachments/ticket/1/6175_flash_update_and_filter_chain%2Btests_r5270.diff

Check for any exceptions near here.

And I assume the permissions on those files are okay?

comment:4 by Christian Boos, 18 years ago

Keywords: attachment added

Well, on the same ticket:

6175_flash_update_and_filter_chain+tests.diff

works fine (check).

So there's nothing wrong here with the "+" and its URL encoding.

Must be a permission issue for the 6175_flash_update_and_filter_chain%2Btests_r5270.diff file.

comment:5 by michael@…, 18 years ago

Priority: normallow

It would appear to have been some kind of encoding problem. The postgres database was created as LATIN 1, and the data was rsynced over. We dumped, iconv'd and reloaded thhe databases, and everything's working now.

comment:6 by Christian Boos, 18 years ago

Resolution: worksforme
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.