+ def manage_upload(self,file='',REQUEST=None):
+ ret = super(File, self).manage_upload(file=file, REQUEST=REQUEST)
+
+ orig_name = OFS.Image.cookId('', '', file)[0]
+ if orig_name :
+ self.orig_name = orig_name
+
+ print self.absolute_url(), self.Format()
+ if self.Format() == 'application/x-shockwave-flash' :
+ if file :
+ try :
+ swfmetadata = parseswf(file)
+ except IOError :
+ swfmetadata = {'width':600, 'height':600}
+
+ for name in ('width', 'height') :
+ value = swfmetadata[name]
+ if self.hasProperty(name) :
+ self._updateProperty(name, value)
+ else :
+ self.manage_addProperty(name, value, 'int')
+ self.reindexObject()
+ return ret
+
+
+