Commit fa58b554 authored by Bartek Górny's avatar Bartek Górny

When downloading, if object has no title, send source_reference as file name...

When downloading, if object has no title, send source_reference as file name (instead of it which is usually a meaningless number).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13539 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 541ffb30
......@@ -73,7 +73,8 @@ if hasattr(context,\'getContentType\'):\n
request.RESPONSE.setHeader(\'Content-type\', context.getContentType())\n
else:\n
request.RESPONSE.setHeader(\'Content-type\', context.getFormat())\n
request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % context.title_or_id())\n
file_name = context.getTitle() or context.getSourceReference()\n
request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % file_name)\n
return context.manage_FTPget()\n
</string> </value>
</item>
......@@ -121,6 +122,7 @@ return context.manage_FTPget()\n
<string>context</string>
<string>request</string>
<string>hasattr</string>
<string>file_name</string>
</tuple>
</value>
</item>
......
278
\ No newline at end of file
279
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment