Hello, Does anyone know to manipulate files within a local filesystem instead of ZODB? Is it possible to do that through a python script or dtml method? Thanks.
On 3 Nov 2005, at 10:41, Thanh Hải, Hà wrote:
Hello,
Does anyone know to manipulate files within a local filesystem instead of ZODB? Is it possible to do that through a python script or dtml method? Thanks.
No it is not. And doing that opens up security risks. You need to write a Python product or external method. jens
2005/11/3, Jens Vagelpohl <jens@dataflake.org>:
No it is not. And doing that opens up security risks. You need to write a Python product or external method.
jens
Is there an example of how to implement it in external method or python product?
On 4 Nov 2005, at 02:42, Thanh Hải, Hà wrote:
2005/11/3, Jens Vagelpohl <jens@dataflake.org>: No it is not. And doing that opens up security risks. You need to write a Python product or external method.
jens
Is there an example of how to implement it in external method or python product?
I don't know, sorry. jens
Am Freitag, den 04.11.2005, 08:42 +0700 schrieb Thanh Hải, Hà:
2005/11/3, Jens Vagelpohl <jens@dataflake.org>: No it is not. And doing that opens up security risks. You need to write a Python product or external method.
jens
Is there an example of how to implement it in external method or python product?
Lukily zope prevents people with too less knowledge from schooting themself in their feet. If you really want to do that, you go for the docs. It isnt that hard but writing to the filesystem thru the web has some (security) cerveats. I'd recommend http://docs.python.org/tut/tut.html to get some grip on python. http://docs.python.org/tut/node9.html#SECTION009200000000000000000 tells you about Files. You should know your fileupload object in REQUEST is also just a file. I'd recommend reading and writing it in chucks to avoid loading it into memory. An external method (see zope book) is just a file with (at least one) function definition where the first argument should be "self" in this case you have access to context via self. Now good luck!
participants (3)
-
Jens Vagelpohl -
Thanh Hải, Hà -
Tino Wildenhain