Hello, I've made a folderish product 'IntraNet' that automatically inserts an UpFolder image at installation. I try to do this as follows: def Add_UpFolderIcon(self): """Add an UpFolder icon to the IntraNet product at installation""" self.manage_addImage('UpFolderIcon', file='www/UpFolder_icon.gif', title='', precondition='', content_type='image/gif' ) It's a gif image, but it only installs a reference to the image (I think). The size of the image in the edit tab is 21 bytes and it is supposed to be 915 bytes. Can someone help me? Thanks, Greetz Nico
From: "Nico de Boer" <nico@nfg.nl>
def Add_UpFolderIcon(self): """Add an UpFolder icon to the IntraNet product at installation""" self.manage_addImage('UpFolderIcon', file='www/UpFolder_icon.gif', title='', precondition='', content_type='image/gif' )
It's a gif image, but it only installs a reference to the image (I think). The size of the image in the edit tab is 21 bytes and it is supposed to be 915 bytes.
Yes, as you surely notice, the length of the string 'www/UpFolder_icon.gif' is 21 bytes. File is not a file reference, but the actual file. The data.
Can someone help me?
It depends. Why are you trying to do this? Images that are a part of the management interface should be located on disk, and images that are a part of the website should only be uploaded once, and then referenced from HTML.
Thanks,
Greetz Nico
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On 7 Mar 2002, Nico de Boer wrote:
Hello,
I've made a folderish product 'IntraNet' that automatically inserts an UpFolder image at installation.
I try to do this as follows:
def Add_UpFolderIcon(self): """Add an UpFolder icon to the IntraNet product at installation""" self.manage_addImage('UpFolderIcon', file='www/UpFolder_icon.gif', title='', precondition='', content_type='image/gif' )
You're making the content of the image object be the string "www/UpFolder..." Instead, open the icon image itself and use its contents as the file. Something like f = open("name","rb") and file=f.read() -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant
participants (3)
-
Joel Burton -
Lennart Regebro -
Nico de Boer