Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In some case, files are downloaded with wrong filenames (+ without their extensions) #568

Open
laulaz opened this issue Aug 9, 2020 · 0 comments

Comments

@laulaz
Copy link
Member

laulaz commented Aug 9, 2020

Here, we check if files should be accessed by their /view (no problem there) or downloaded directly from the listing macro :

item_link python:item_type in view.use_view_action and item_url+'/view' or item_url;

If your content doesn't have the plone.namefromfilename behavior (or if you rename it), you can end up with :

  • content title : "My file"
  • generated (or renamed) content id : "my-file"
  • uploaded filename : "foo.pdf"

There is a problem in that case if File is not in plone.types_use_view_action_in_listings : the listing macro will then propose a download url for the file leading to the download of "my-file" instead of "foo.pdf", thus with a wrong filename and without extension.

Shouldn't we use item_url + '/@@download/file' url in listings to solve that problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants