Commit 60d2408c authored by 's avatar

Fixes to get_size

parent 63f78ddc
......@@ -84,7 +84,7 @@
##############################################################################
"""Image object"""
__version__='$Revision: 1.61 $'[11:-2]
__version__='$Revision: 1.62 $'[11:-2]
import Globals, string, struct, mimetypes, content_types
from Globals import HTMLFile, MessageDialog
......@@ -247,6 +247,8 @@ class File(Persistent,Implicit,PropertyManager,
self.dav__init(REQUEST, RESPONSE)
type=REQUEST.get_header('content-type', None)
body=REQUEST.get('BODY', '')
if not len(body):
raise 'bullshit', 'bullshit'
if type is None:
type, enc=mimetypes.guess_type(self.id())
if type is None:
......@@ -264,6 +266,7 @@ class File(Persistent,Implicit,PropertyManager,
Returns the size of the file or image.
"""
return len(self.data)
get_size=getSize
def getContentType(self):
"""Get the content type of a file or image.
......
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