Index: main/waeup.ikoba/trunk/src/waeup/ikoba/browser/fileviewlets.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/browser/fileviewlets.py	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/browser/fileviewlets.py	(revision 12444)
@@ -109,5 +109,9 @@
     label = _(u'File')
     title = _(u'Scan')
-    download_name = u'filename.jpg'
+    download_name = None
+
+    @property
+    def download_filename(self):
+        return u"%s.pdf" % self.context.document_id[:9]
 
     @property
@@ -131,4 +135,8 @@
     upload_button =_('Upload selected file')
     delete_button = _('Delete')
+
+    @property
+    def download_filename(self):
+        return u"%s.pdf" % self.context.document_id[:9]
 
     @property
@@ -175,6 +183,9 @@
     """
     grok.baseclass()
-    grok.name('none.jpg')
-    download_name = u'none.jpg'
+    download_name = None
+
+    @property
+    def download_filename(self):
+        return u"%s.pdf" % self.context.document_id[:9]
 
     def render(self):
@@ -198,3 +209,6 @@
         elif ext == '.tif':
             self.response.setHeader('Content-Type', 'image/tiff')
+        if self.download_filename:
+            self.response.setHeader('Content-Disposition',
+                'attachment; filename="%s' % self.download_filename)
         return image
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/filedisplay.pt
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/filedisplay.pt	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/filedisplay.pt	(revision 12444)
@@ -5,5 +5,5 @@
   <td>
     <a tal:attributes="href python: view.url(context, viewlet.download_name)"
-       tal:content="viewlet/download_name"
+       tal:content="viewlet/download_filename"
        target="image">
       LINK
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/fileupload.pt
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/fileupload.pt	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/fileupload.pt	(revision 12444)
@@ -7,5 +7,5 @@
     <tal:file tal:condition="viewlet/file_exists">
       <a tal:attributes="href python: view.url(context, viewlet.download_name)"
-         tal:content="viewlet/title"
+         tal:content="viewlet/download_filename"
          target="image">
         LINK
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py	(revision 12444)
@@ -97,4 +97,7 @@
 class SampleScanEditUpload(SampleScanManageUpload):
     """Scan upload viewlet for customer.
+
+    If a user has both permissions, waeup.manageCustomer and
+    waeup.handleCustomer, the upload viewlet appears twice.
     """
     grok.view(DocumentEditFormPage)
@@ -121,4 +124,5 @@
     grok.require('waeup.viewCustomer')
     download_name = u'sample'
+
 
 class SampleScanPDFSlip(SampleScanDisplay):
@@ -166,4 +170,5 @@
     download_name = u'sample.pdf'
 
+
 class PDFScanSlip(PDFScanDisplay):
     grok.view(PDFDocumentSlipPage)
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12444)
@@ -1104,6 +1104,6 @@
             name='upload_pdfscanmanageupload').click()
         self.assertTrue(
-            'href="http://localhost/app/customers/K1000000/documents/%s/sample.pdf">PDF File</a>'
-            % docid in self.browser.contents)
+            'href="http://localhost/app/customers/K1000000/documents/%s/sample.pdf">%s.pdf</a>'
+            % (docid, docid[:9]) in self.browser.contents)
         # Browsing the link shows a real pdf
         self.browser.open('sample.pdf')
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py	(revision 12444)
@@ -146,5 +146,5 @@
     form_fields_interface = IPDFDocument
 
-    filenames = ('scan.pdf',)
+    filenames = ('file.pdf',)
 
 PDFDocument = attrs_to_fields(PDFDocument)
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/fileviewlets.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/fileviewlets.py	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/fileviewlets.py	(revision 12444)
@@ -40,5 +40,5 @@
     title = _(u'PDF File')
     mus = 1024 * 200
-    download_name = u'sample.pdf'
+    download_name = u'file.pdf'
     tab_redirect = '#tab2'
 
@@ -53,5 +53,5 @@
     label = _(u'PDF Scan')
     title = _(u'PDF Scan')
-    download_name = u'sample.pdf'
+    download_name = u'file.pdf'
 
 
@@ -59,9 +59,8 @@
     """Scan document.
     """
-    ##: Needs to be protected if not published
-    grok.name('sample.pdf')
+    grok.name('file.pdf')
     grok.context(PDFDocument)
     grok.require('waeup.Public')
-    download_name = u'sample.pdf'
+    download_name = u'file.pdf'
 
     def update(self):
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py	(revision 12443)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py	(revision 12444)
@@ -148,9 +148,9 @@
             name='upload_pdfscanmanageupload').click()
         self.assertTrue(
-            'href="http://localhost/app/documents/DOC1/sample.pdf">PDF File</a>'
+            'href="http://localhost/app/documents/DOC1/file.pdf">DOC1.pdf</a>'
             in self.browser.contents)
         # The file can be found in the file system
         file = getUtility(IExtFileStore).getFileByContext(
-            document, attr='sample.pdf')
+            document, attr='file.pdf')
         file_content = file.read()
         pdf.seek(0)
@@ -159,12 +159,16 @@
         # Browsing the link shows a real pdf only if the document
         # has been published
-        self.browser.getLink("PDF File").click()
+        self.browser.getLink("DOC1.pdf").click()
         self.assertTrue(
             'The document requested has not yet been published'
             in self.browser.contents)
         IWorkflowState(document).setState(PUBLISHED)
-        self.browser.open(self.container_path + '/DOC1/sample.pdf')
+        self.browser.open(self.container_path + '/DOC1/file.pdf')
         self.assertEqual(
             self.browser.headers['content-type'], 'application/pdf')
+        # The name of the downloaded file will be different
+        self.assertEqual(
+            self.browser.headers['Content-Disposition'],
+            'attachment; filename="DOC1.pdf')
 
         # Transitions can be performed
@@ -186,5 +190,5 @@
         # File has been removed too
         file = getUtility(IExtFileStore).getFileByContext(
-            document, attr='sample.pdf')
+            document, attr='file.pdf')
         self.assertTrue(file is None)
 
@@ -204,5 +208,5 @@
             % document.document_id in logcontent)
         self.assertTrue(
-            'INFO - zope.mgr - documents.browser.DocumentManageFormPage - %s - uploaded: sample.pdf (my_sample_scan.pdf)'
+            'INFO - zope.mgr - documents.browser.DocumentManageFormPage - %s - uploaded: file.pdf (my_sample_scan.pdf)'
             % document.document_id in logcontent)
         self.assertTrue(
