Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-445

Uploaded assets are not given a web-safe filename; are unreachable

XMLWordPrintable

      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:
      • Click Rename Asset and give it a web-safe filename.
      • Click Edit Asset and give it the same web-safe filename in the Media > Name field (yes, you must to both these renaming actions in this order).
      • Publish.

      If the asset has not yet been uploaded:
      • Upload the asset but change the filename to a safe one in the Media > Name field before saving changes.
      • Publish the asset.

      ========

      Steps to reproduce on the demo site http://demo.magnolia-cms.com as follows:
      • Go to the Assets page.
      • Into demo-project/downloads, upload any random file whose name is valid, eg "this-is-ok.txt".
      • Publish the asset.
      • Confirm you're offered the file for download via the public url, eg: http://demo.magnolia-cms.com/dam/demo-project/downloads/this-is-ok.txt

      • Now upload another file whose name is invalid, eg "spaces in this name.txt".
      • Publish the asset.
      • Confirm you CANNOT reach the file for download via the public url, eg: http://demo.magnolia-cms.com/dam/demo-project/downloads/spaces%20in%20this%20name.txt

      • Now click [Edit Asset] and give it a safe name, eg "no-spaces-in-this-name", and click [Save Changes].
      • Notice the Asset Name in the list/tree view of Assets has NOT changed.
      • Click [Rename Asset], notice the Name is actually correct, and click [Save Changes] without doing anything else.
      • Notice the Asset Name in the list/tree view of Assets has changed to the new value.
      • Publish the asset.
      • Confirm you're now offered the file for download via the public url, eg: http://demo.magnolia-cms.com/dam/demo-project/downloads/no-spaces-in-this-name.txt

      ========

      Issues possiblly related?
      https://jira.magnolia-cms.com/browse/MGNLFORM-208
      https://jira.magnolia-cms.com/browse/MGNLDAM-310
      https://jira.magnolia-cms.com/browse/MGNLDAM-423

        Acceptance criteria

              Unassigned Unassigned
              rgibson Rory Gibson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD