[Zope] Upload Photo objects in a localFS

William GARCIA wgarcia@esrf.fr
Tue, 07 May 2002 13:57:17 +0200


--=====================_625568078==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

I have a local file system named images.
I would like to write-in photo objects.
When I write an Image object with
<dtml-with images>
   <dtml-call 
"manage_addProduct['OFSP'].manage_addImage(REQUEST['id_img'],file,'')">
  </dtml-with>
there is no problem, but when I try to write a Photo object with
<dtml-with images>
   <dtml-call expr="manage_addProduct['Photo'].manage_addPhoto(id_img, '', 
file)">
  </dtml-with>

Zope generate the next error :
Error Type: Bad Request
Error Value: Cannot add objects of type 'Photo' to local directories.

Traceback (innermost last):
   File 
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 
150, in publish_module
   File 
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 
114, in publish
   File /zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Zope/__init__.py, 
line 159, in zpublisher_exception_hook
     (Object: recherche_indexation_mysql)
   File 
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 
98, in publish
   File /zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py, 
line 88, in mapply
     (Object: 5addImageLFS)
   File 
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line 
39, in call_object
     (Object: 5addImageLFS)
   File /zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, 
line 127, in __call__
     (Object: 5addImageLFS)
   File 
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py, 
line 473, in __call__
     (Object: 5addImageLFS)
   File 
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_With.py, 
line 76, in render
     (Object: images)
   File 
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Util.py, 
line 159, in eval
     (Object: manage_addProduct['Photo'].manage_addPhoto(id_img, '', file))
     (Info: id_img)
   File <string>, line 2, in f
   File /zope/web/Products/Photo/Photo.py, line 655, in manage_addPhoto
   File 
/zope/Zope-2.4.3-solaris-2.6-sparc/lib/python/Products/LocalFS/LocalFS.py, 
line 547, in _setObject
     (Object: images)
   File 
/zope/Zope-2.4.3-solaris-2.6-sparc/lib/python/Products/LocalFS/LocalFS.py, 
line 571, in _safe_setOb
     (Object: images)
   File 
/zope/Zope-2.4.3-solaris-2.6-sparc/lib/python/Products/LocalFS/LocalFS.py, 
line 586, in _setOb
     (Object: images)
Bad Request: (see above)


The problem is certainly due to the fact contrarily to Image, the Photo 
product isn't included in the local file system properties
If someone know how to include the Photo product in the localFS properties, 
I'm sincerely interested.
Thanks in advance for the help or the ideas you can give to me.
William.

--=====================_625568078==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
I have a local file system named images. <br>
I would like to write-in photo objects. <br>
When I write an Image object with <br>
&lt;dtml-with images&gt;<br>
&nbsp; &lt;dtml-call
&quot;manage_addProduct['OFSP'].manage_addImage(REQUEST['id_img'],file,'')&quot;&gt;<br>
&nbsp;&lt;/dtml-with&gt; <br>
there is no problem, but when I try to write a Photo object with <br>
&lt;dtml-with images&gt;<br>
&nbsp; &lt;dtml-call
expr=&quot;manage_addProduct['Photo'].manage_addPhoto(id_img, '',
file)&quot;&gt;<br>
&nbsp;&lt;/dtml-with&gt; <br><br>
Zope generate the next error :<br>
<b>Error Type: Bad Request<br>
Error Value: Cannot add objects of type 'Photo' to local
directories.<br><br>
</b>Traceback (innermost last):<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
150, in publish_module<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
114, in publish<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Zope/__init__.py, line 159,
in zpublisher_exception_hook<br>
&nbsp;&nbsp;&nbsp; (Object: recherche_indexation_mysql)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
98, in publish<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py, line
88, in mapply<br>
&nbsp;&nbsp;&nbsp; (Object: 5addImageLFS)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publish.py, line
39, in call_object<br>
&nbsp;&nbsp;&nbsp; (Object: 5addImageLFS)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py, line
127, in __call__<br>
&nbsp;&nbsp;&nbsp; (Object: 5addImageLFS)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_String.py,
line 473, in __call__<br>
&nbsp;&nbsp;&nbsp; (Object: 5addImageLFS)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_With.py,
line 76, in render<br>
&nbsp;&nbsp;&nbsp; (Object: images)<br>
&nbsp; File
/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_Util.py,
line 159, in eval<br>
&nbsp;&nbsp;&nbsp; (Object:
manage_addProduct['Photo'].manage_addPhoto(id_img, '', file))<br>
&nbsp;&nbsp;&nbsp; (Info: id_img)<br>
&nbsp; File &lt;string&gt;, line 2, in f<br>
&nbsp; File /zope/web/Products/Photo/Photo.py, line 655, in
manage_addPhoto<br>
&nbsp; File
/zope/Zope-2.4.3-solaris-2.6-sparc/lib/python/Products/LocalFS/LocalFS.py,
line 547, in _setObject<br>
&nbsp;&nbsp;&nbsp; (Object: images)<br>
&nbsp; File
/zope/Zope-2.4.3-solaris-2.6-sparc/lib/python/Products/LocalFS/LocalFS.py,
line 571, in _safe_setOb<br>
&nbsp;&nbsp;&nbsp; (Object: images)<br>
&nbsp; File
/zope/Zope-2.4.3-solaris-2.6-sparc/lib/python/Products/LocalFS/LocalFS.py,
line 586, in _setOb<br>
&nbsp;&nbsp;&nbsp; (Object: images)<br>
Bad Request: (see above)<br><br>
<br>
The problem is certainly due to the fact contrarily to Image, the Photo
product isn't included in the local file system properties<br>
If someone know how to include the Photo product in the localFS
properties, I'm sincerely interested.<br>
Thanks in advance for the help or the ideas you can give to me.<br>
William.<br>
</html>

--=====================_625568078==_.ALT--