[MGNLDAM-445] Uploaded assets are not given a web-safe filename; are unreachable Created: 14/May/14 Updated: 18/Sep/14 Resolved: 17/Jul/14 |
|
| Status: | Closed |
| Project: | Magnolia DAM Module |
| Component/s: | DAM Core, User Interaction |
| Affects Version/s: | 1.0 |
| Fix Version/s: | 1.2.6, 2.0.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Rory Gibson | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | dam | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
If you upload any file to Assets via the admin site, without a web-safe filename – that is, anything that falls foul of regex /[0-9A-Za-z_-]+/ – the system will attempt to convert the filename for you but silently fails to actually do so, even though the displayed filename appears to conform to the rule above. However, you cannot be served the file via the public site via the DAM as it will fail to be found (404). If you click the Rename Asset link (with the file selected) you will note it still has the original unsafe filename. The temporary workaround we're using for this is as follows: If the asset has already been uploaded: If the asset has not yet been uploaded: ======== Steps to reproduce on the demo site http://demo.magnolia-cms.com as follows: • Now upload another file whose name is invalid, eg "spaces in this name.txt". • Now click [Edit Asset] and give it a safe name, eg "no-spaces-in-this-name", and click [Save Changes]. ======== Issues possiblly related? |
| Comments |
| Comment by Peter Phillips [ 15/May/14 ] |
|
If Magnolia detects that the filename is unsafe, it appears to create an extra section to the filename including the sanitised filename in the path of the download. I'm guessing that if the sanitised filename is the same as the actual one then this step is then missed out, hence guessing the URL by adding /dam/ and the filename extension then works. Hence "spaces in this name.txt" is actually then available under http://demo.magnolia-cms.com/demo-project/dam/demo-project/downloads/spaces-in-this-name/spaces%20in%20this%20name.txt instead. Unfortunately due to there being no download link on the asset page (https://jira.magnolia-cms.com/browse/MGNLDAM-423) this is not obvious. The only way to find out the true URL for the download link is then to add a link to the asset to a page and then look at the resulting link when previewing the page. I've tried on the demo site and been able to upload the "spaces in this name.txt" asset and then download it successfully after adding it as a link on a page to get the URL. Therefore I think that altough the uploaded assets are not given a web-safe filename, they are still reachable and can be downloaded okay. |
| Comment by Eric Hechinger [ 17/Jul/14 ] |
|
I did the following test:
Will close the issue. |