[CMF-checkins] CVS: CMF - File.py:1.7

Martijn Pieters mj@digicool.com
Thu, 3 May 2001 14:27:04 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault
In directory korak:/tmp/cvs-serv17470/CMFDefault

Modified Files:
	File.py 
Log Message:
- Deprecated the CMFDefault.File.download method. It is still available, but
  is no longer called by the current CMF skin, nor is index_html aliased to
  it.

  The method was necessary when the "View' method was the default action
  when calling the URL of the File object, this is no longer the case. The
  setting of the Content-Disposition header is not needed when using the
  absolute URL of the object, and causes certain browsers to misbehave.



--- Updated File File.py in package CMF --
--- File.py	2001/04/08 19:18:18	1.6
+++ File.py	2001/05/03 18:27:03	1.7
@@ -228,18 +228,21 @@
     edit = WorkflowAction(edit)
 
     def download(self, REQUEST, RESPONSE):
-        """
-        Download this item.  Calls OFS.Image.File.index_html to perform the
-        actual transfer after first setting Content-Disposition to suggest
-        a filename.
+        """Download this item.
+        
+        Calls OFS.Image.File.index_html to perform the actual transfer after
+        first setting Content-Disposition to suggest a filename.
+        
+        This method is deprecated, use the URL of this object itself. Because
+        the default view of a File object is to download, rather than view,
+        this method is obsolete. Also note that certain browsers do not deal
+        well with a Content-Disposition header.
+
         """
 
         RESPONSE.setHeader('Content-Disposition',
                            'attachment; filename=%s' % self.getId())
         return OFS.Image.File.index_html(self, REQUEST, RESPONSE)
-
-    index_html = download
-
 
 Globals.default__class_init__(File)