Ticket #2348 (new defect)

Opened 8 years ago

Last modified 8 years ago

Enforce true file name in downloads.

Reported by: gracinet Owned by: gracinet
Priority: P2 Milestone: CPS 3.5.7
Component: CPS (global) Version: 3.5.2
Severity: normal Keywords:


File download URIs in CPS look like this: downloadFile/field_name/filename.ext

The last URI segment is actually inert and is just meant so that the browser saves it with the correct name. So far so good, but things get complicated if users start linking to file downloads from a document to another.

Typical situation :

  • File document at sections/accounting/yearly-report
  • file object attached in the document, named 'report2010.pdf'
  • presentation page (Web Document) at sections/all_reports linking directly to the file object, e.g with the relative path URI : accounting/yearly-report/downloadFile/file/report2010.pdf

When report2010.pdf gets replaced by report2011.pdf, the link serves the correct document but the browser still saves it as report2010.pdf

Needless to say, trying to explain that to users is nothing but learning what utter confusion means.

Change History

comment:1 Changed 8 years ago by gracinet

Done by a simple check during processing of the download request and redirect (302) in case the file name is inconsistent. This should solve most cases, still need to check what happens with browser dialog for "Save attachment as", if that's before the actual download.

Note: See TracTickets for help on using tickets.