Tom Deprez writes:
Is this possible? How can I let Zope put a file on a clients directory (through python.?) Zope (and its python) live on the server. They can not reach your client directory (without the help from a program on your client).
Your options: * set a content type in the generated file that tells the browser that the file should be stored and not shown, e.g.: <dtml-call "RESPONSE.setHeader('Content-Type','application')"> The browser will in this case pop up a file dialog where you can specify where to put the file. * Use a Python script (e.g. ZPublisher.Client) on your client to fetch the file and store it * Write some Java applet that fetch the file and stores it. You will need to give it high permissions (you probably will need to sign it), such that it is able to write to your local file system. For obvious security reasons, normal Java applets are not allowed to write to your file system. Dieter
Dieter Maurer wrote:
* set a content type in the generated file that tells the browser that the file should be stored and not shown, e.g.:
<dtml-call "RESPONSE.setHeader('Content-Type','application')">
Aaggghhh! Please use a valid mime type format for the Content-Type. 'application/binary' would be much preferred to what was suggested. Mime types should have two halves. --sam -- ------------------------------------------------ "It feels much better than it ever did, much more sensitive" --John Wayne Bobbitt
Alternatively, if the client systems are using Windows (exclusively), you could write a COM object (in Python, C++, VB, Delphi, or whatever), and enbed this in the page instead. This would have issues when installing, but would automatically have the rights to access the file system. This is a good example of the power of using COM objects in web pages, but also of the reason why users have every cause to be wary of accepting COM objects from untrusted sources. The result will be much the same as the Java option. However, if you can work with the program using the data, it would probably be preferable to either change it so it accesses the central location directly, or to embed a function in it that periodically retrieves the latest version itself. Alternatively, you could write a little program that retrieves the data from the central data store periodically, that is installed and set to run when a machine is started, which would probably also be a more reliable system. Even more cunning might be a program that starts up the database program and also checks whether that program is still running - net result, it downloads updates when the database program is running, and closes when it's not needed. David ----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Tom Deprez" <tom.deprez@uz.kuleuven.ac.be> Cc: <zope@zope.org> Sent: Wednesday, March 21, 2001 8:57 PM Subject: Re: [Zope] creating a file on a client
Tom Deprez writes:
Is this possible? How can I let Zope put a file on a clients directory (through python.?) Zope (and its python) live on the server. They can not reach your client directory (without the help from a program on your client).
Your options:
* set a content type in the generated file that tells the browser that the file should be stored and not shown, e.g.:
<dtml-call "RESPONSE.setHeader('Content-Type','application')">
The browser will in this case pop up a file dialog where you can specify where to put the file.
* Use a Python script (e.g. ZPublisher.Client) on your client to fetch the file and store it
* Write some Java applet that fetch the file and stores it.
You will need to give it high permissions (you probably will need to sign it), such that it is able to write to your local file system.
For obvious security reasons, normal Java applets are not allowed to write to your file system.
Dieter
_______________________________________________ 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 )
participants (3)
-
David Burton -
Dieter Maurer -
sam gendler