Hi, Is it possible to let a client-pc log into a Zope Server with a request send some information, The Zope Server handles the request and sends a file with data to a directory on the client... Is this possible? How can I let Zope put a file on a clients directory (through python.?) Thanks for any ideas. Tom.
Tom Deprez wrote:
Hi,
Is it possible to let a client-pc log into a Zope Server with a request send some information, The Zope Server handles the request and sends a file with data to a directory on the client...
Is this possible? How can I let Zope put a file on a clients directory (through python.?)
Thanks for any ideas.
Tom.
If you are asking if a web server can create a file in an arbitrary directory on a client, the answer is a definite no. This would be a very bad thing(tm). However a browser can create files on clients in two ways: Setting a cookie creates a file, but is unlikely what you want because it is a browser specific file. All browsers support file downloads. If the browser doesn't know what to do with the file (it does not have a helper-app or plug-in associated with it) it will ask the user to save the file. The user can then place the file in an directory he/she wants to. You could make this file an executable that when run (by the user) places a files in any directory you want (like an installer). If you are dealing with clients on an internal network, you could write a program that facilitates this either as a browser helper-app or a standalone application. There are serious security implications to this however. What is you purpose in doing this? perhaps there is a different approach. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
What is you purpose in doing this? perhaps there is a different approach.
It is intended for using it at an intranet. At the moment several clients search a database and return a file on a certain directory which is then read and used by another pc. This means that on all clients certain database libraries, perl libraries, etc have to be installed and updated now and then. In a wild idee, we would like to get rid of this system and if possible use one point on which the database libraries (etc) need to be installed. The client then asks on that computer for searching the information. The server returns it back and places a file on the client, so that the other program can use it, like it does before. I can be that on a later stage, people need a sort of gui to make a selection out of a list of data. Selecting one will create the file. The gui will probably be the webbrowser. The problem is that it in fact should work automatically, ie in the first fase (thus no list) the user should not have to click on a button to download the file. This would be too annoying since I guess then they have to push that button every 5 minutes... Same for the list, clicking on a row should automatically create the file. The benefits of this central station is off course that we only have to change things on one place... I think Zope would be very helpfull... At the moment we've a perl script to connect to the database. We could probably just use this one in the testing fase (Perl scripts or External Perl Methods). If we need to create the gui... Zope would do just fine. But is it possible? Tom.
Tom Deprez wrote:
What is you purpose in doing this? perhaps there is a different approach.
It is intended for using it at an intranet. At the moment several clients search a database and return a file on a certain directory which is then read and used by another pc. This means that on all clients certain database libraries, perl libraries, etc have to be installed and updated now and then. In a wild idee, we would like to get rid of this system and if possible use one point on which the database libraries (etc) need to be installed. The client then asks on that computer for searching the information. The server returns it back and places a file on the client, so that the other program can use it, like it does before. I can be that on a later stage, people need a sort of gui to make a selection out of a list of data. Selecting one will create the file. The gui will probably be the webbrowser. The problem is that it in fact should work automatically, ie in the first fase (thus no list) the user should not have to click on a button to download the file. This would be too annoying since I guess then they have to push that button every 5 minutes... Same for the list, clicking on a row should automatically create the file. The benefits of this central station is off course that we only have to change things on one place... I think Zope would be very helpfull... At the moment we've a perl script to connect to the database. We could probably just use this one in the testing fase (Perl scripts or External Perl Methods). If we need to create the gui... Zope would do just fine. But is it possible?
Tom.
Does this file have to physically reside on the client PC or could it be served from a central file server? What does this client-side program actually do with this file? -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
----- Original Message ----- From: "Casey Duncan" <cduncan@kaivo.com> To: "Tom Deprez" <tom.deprez@uz.kuleuven.ac.be> Cc: <zope@zope.org>; "Tom Deprez (Home)" <Tom.Deprez@village.uunet.be> Sent: Wednesday, March 21, 2001 10:11 PM Subject: Re: [Zope] creating a file on a client
Tom Deprez wrote:
What is you purpose in doing this? perhaps there is a different approach.
It is intended for using it at an intranet. At the moment several
clients
search a database and return a file on a certain directory which is then read and used by another pc. This means that on all clients certain database libraries, perl libraries, etc have to be installed and updated now and then. In a wild idee, we would like to get rid of this system and if possible use one point on which the database libraries (etc) need to be installed. The client then asks on that computer for searching the information. The server returns it back and places a file on the client, so that the other program can use it, like it does before. I can be that on a later stage, people need a sort of gui to make a selection out of a list of data. Selecting one will create the file. The gui will probably be the webbrowser. The problem is that it in fact should work automatically, ie in the first fase (thus no list) the user should not have to click on a button to download the file. This would be too annoying since I guess then they have to push that button every 5 minutes... Same for the list, clicking on a row should automatically create the file. The benefits of this central station is off course that we only have to change things on one place... I think Zope would be very helpfull... At the moment we've a perl script to connect to the database. We could probably just use this one in the testing fase (Perl scripts or External Perl Methods). If we need to create the gui... Zope would do just fine. But is it possible?
Tom.
Does this file have to physically reside on the client PC or could it be served from a central file server?
Yes, this file has to reside on the client PC.
What does this client-side program actually do with this file?
Another program (from a firm) on this computer reads the file and parses the contents (eg patient data: name, ...) . It uses this information to put it on a radiographic cassette, the information identifies the patient. Regards; Tom
Tom, There is a few options here. All of these are hacks, for security reasons outlined by others. Would it be an idea to give the file a costum mime-type and assign that to a specific program? You don't say whether you (1) need the actual file on the client computer or (2) could also start parsing the data in the actual application in which you will use the file later on anyway Setting the mime type is done in the way Dieter Maurer exposed in an earlier response: <dtml-call "RESPONSE.setHeader('Content-Type','application/binary')"> where application/binary has to be you custom type you have to invent if (2) you'll be set if you assign this mime type to the application in the browser's preferences if (1) you will have to make a simple program (a simple (python)script would be enough) that saves this to the filesystem to a location the program knows about hth Rik
Tom,
There is a few options here. All of these are hacks, for security reasons outlined by others. Would it be an idea to give the file a costum mime-type and assign that to a specific program? You don't say whether you (1) need the actual file on the client computer or (2) could also start parsing the data in the actual application in which you will use the file later on anyway
Setting the mime type is done in the way Dieter Maurer exposed in an earlier response:
<dtml-call "RESPONSE.setHeader('Content-Type','application/binary')">
where application/binary has to be you custom type you have to invent
if (2) you'll be set if you assign this mime type to the application in the browser's preferences if (1) you will have to make a simple program (a simple (python)script would be enough) that saves this to the filesystem to a location the program knows about
hth
mmmm. with (1), where does this python program has to reside? Can it be placed in Zope (thus server) itself, or does it has to live on the client? The file needs to be put on the client. I never thought on (2)... but this would imply almost the same... then I've to create an application which will intercept the mime-type, parses the data and sends the results in a file on a directory in the client. I can't change the program which uses the file, because it's from the manufacturer of a system and I don't have the code of it. Tom.
mmmm. with (1), where does this python program has to reside? Can it be placed in Zope (thus server) itself, or does it has to live on the client?
Everything is client side, so it has to reside on the client. Yes - this means distributing a program or doing it with client-side com as David Burton suggests. There are some documents about doing this on the web and presumably also in the pythoncom distribution (or the ActivePython distribution by ActiveState)
The file needs to be put on the client. I never thought on (2)... but this would imply almost the same... then I've to create an application which
will
intercept the mime-type, parses the data and sends the results in a file on a directory in the client.
I don't think I was clear. Taken that the file you make Zope return (i.e. the file arriving at the client side) is readable directly by the application, setting the application from the browser preferences would suffice. This is the same that happens when for a pdf file is automatically shown (IE does the same for MSOffice applications). The browser will open the program for you and send the file to the application. This is the same mechanism windows use by associating file extensions with programs.
I can't change the program which uses the file, because it's from the manufacturer of a system and I don't have the code of it.
I don't think you will have to change anything in the program itself. Rik
Thank you all for the information! I somehow missed the comments from Dieter and Sam. But I managed to find them thanks to the referals of Rik. Regards, Tom.
participants (4)
-
Casey Duncan -
Rik Hoekstra -
Tom Deprez -
Tom Deprez