Spaces in URLs converted to %20 and %20%20
mrweaver - December 17, 2008 - 19:25
| Project: | Mime Mail |
| Version: | 6.x-1.0-alpha1 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
For a simplenews newsletter, I have a file attached for each issue. The URL to the attached file that is sent in the email and the link provided in the submitted node generate 404 errors.
Any help?
Thanks
mrweaver

#1
No activity, closing the issue.
#2
I found the same thing, what I found is files with spaces in them were getting "double spaces" in the generated url, but just in the email, not the link on the website.
#3
I'm changing this to a bug report. Can anyone help?
When files are attached, the email actually shows the attachment in two ways. First it is physically attached to the email - great this works. Second there is an "Attachments" section at the bottom that lists files and their sizes with links to the files on the website. This looks just like the website does, however the link does not work. It adds a second space (%20) for one of the spaces in the file name. Even stranger it is not consistent which one of the spaces is doubled, in one file the second space was doubled, in another the third space was doubled.
For example, on this node: http://www.bedfordscouts.ca/cubs/posting/1st-bedford-b-cub-pack-fall-camp
The email generated the link incorrectly: (notice after the word Bedford in the file name - two %20)
The website generated the link like correctly. (notice after the word Bedford in the file name - one space)
Email HTML:
<a href="http://www.bedfordscouts.ca/files/1st%20Bedford%20%20
Cub%20Pack%20-%20Fall%20Camp%20-%20Info%20Slip.pdf">1st Bedford Cub Pack - Fall Camp - Info
Slip.pdf</a>
Website HTML
<a href="http://www.bedfordscouts.ca/files/1st Bedford Cub Pack - Fall Camp - Info Slip.pdf">1st Bedford Cub Pack - Fall Camp - Info Slip.pdf</a>
Honestly I'd prefer to only have real attachments and not links to the attachments in the emails but if they're going appear as links they need to work.
Thanks,
Chris
#4
I just noticed a bit more. Below is the whole HTML source for the attachments table from the email. Notice that the double %20 appear on the space next to the line break. I don't know what this means but more knowledge might someone help me out here.
<table id="attachments" class="sticky-enabled">
<thead><tr>
<th>Attachment</th>
<th>Size</th> </tr></thead>
<tbody>
<tr class="odd">
<td><a href="http://www.bedfordscouts.ca/files/1st%20Bedford%20%20
Cub%20Pack%20-%20Fall%20Camp%20-%20Info%20Slip.pdf">1st Bedford Cub Pack - Fall Camp - Info
Slip.pdf</a></td>
<td>16.05 KB</td> </tr>
<tr class="even">
<td><a href="http://www.bedfordscouts.ca/files/Cabin%20Camp%20%20
Gear%20List%20ALL.pdf">Cabin Camp Gear List ALL.pdf</a></td>
<td>98.15 KB</td>
</tr>
<tr class="odd">
<td><a href="http://www.bedfordscouts.ca/files/How%20to%20make%20a%20%20
Tin%20Foil%20Dinner.pdf">How to make a Tin Foil Dinner.pdf</a></td>
<td>767.22
KB</td> </tr>
</tbody>
</table>
#5
There is also a issue in the queue about converting spaces into %20. I'm not sure is these are simplenews or mime mail issues. Please check the mime mail issue queue too. and make sure you use latest development versions of both modules!
#6
With this issue #291903: Properly convert file URLs to paths the space to %20 conversion was added mimemail. And from the size of the issue, this is a complex matter.
Moving this to mime mail.