[HELP] How to get the content of a REQUEST
Hello, There is something (maybe simple) that i don't manage do to. I want to get the content of a REQUEST from a python script. In fact, there is another application (adobe PDF form) that calls my zope site via a POST method REQUEST and give me the file in-line in the request. I want to get the content of this file in order to generate a file object stored in my ZoDB. Is there something like : REQUEST.getContent() REQUEST.read() Help needed. Thanks in advance Frédéric P.S : Execuse my english _________________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com
Your approach is somewhat weird. The REQUEST does not hold any content from any object. You can use restrictedTraverse() to *obtain* a reference to the corresponding object *with the informations* stored *with the REQUEST*. if you have the refreence to the object you can use the API of the object to retrieve its content. -aj --On Sonntag, 11. Januar 2004 12:23 Uhr +0100 Frédéric LEMAITRE <fred_lemaitre@yahoo.com> wrote:
Hello,
There is something (maybe simple) that i don't manage do to. I want to get the content of a REQUEST from a python script.
In fact, there is another application (adobe PDF form) that calls my zope site via a POST method REQUEST and give me the file in-line in the request.
I want to get the content of this file in order to generate a file object stored in my ZoDB.
Is there something like : REQUEST.getContent() REQUEST.read()
Help needed. Thanks in advance Frédéric
P.S : Execuse my english
_________________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Hello, I don't really agree. In fact, the "object" from which i want the content isn't stored in the ZODB. Adobe Acrobat calls my python script witch the content in-line in the request. My need is to : -1- Create an ZODB file named "My_File.pdf" ==> Ok -2- Put the content of the REQUEST (the content of the PDF file) into the "My_File.pdf" ==> My question is how to get the content passed in-line in the REQUEST. I'm gonna try "my_content = context.REQUEST['BODY']" (thanks Ed Leafe). Fr�d�ric. --- Andreas Jung <andreas@andreas-jung.com> wrote:
Your approach is somewhat weird. The REQUEST does not hold any content from any object. You can use restrictedTraverse() to *obtain* a reference to the corresponding object *with the informations* stored *with the REQUEST*. if you have the refreence to the object you can use the API of the object to retrieve its content.
-aj
--On Sonntag, 11. Januar 2004 12:23 Uhr +0100 Fr�d�ric LEMAITRE <fred_lemaitre@yahoo.com> wrote:
Hello,
There is something (maybe simple) that i don't manage do to. I want to get the content of a REQUEST from a python script.
In fact, there is another application (adobe PDF form) that calls my zope site via a POST method REQUEST and give me the file in-line in the request.
I want to get the content of this file in order to generate a file object stored in my ZoDB.
Is there something like : REQUEST.getContent() REQUEST.read()
Help needed. Thanks in advance Fr�d�ric
P.S : Execuse my english
__________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus
"Frédéric" LEMAITRE wrote at 2004-1-12 05:00 -0800:
In fact, the "object" from which i want the content isn't stored in the ZODB.
Someone send you the answer to your question (at least as I understand your question): REQUEST.BODY Does it not work? -- Dieter
Hello Dieter, Yes, REQUEST.BODY works fine. Thanks. Frederic. --- Dieter Maurer <dieter@handshake.de> wrote:
"Fr�d�ric" LEMAITRE wrote at 2004-1-12 05:00 -0800:
In fact, the "object" from which i want the content isn't stored in the ZODB.
Someone send you the answer to your question (at least as I understand your question):
REQUEST.BODY
Does it not work?
-- Dieter
__________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus
On Jan 11, 2004, at 6:23 AM, Frédéric LEMAITRE wrote:
Is there something like : REQUEST.getContent() REQUEST.read()
I have some Zope scripts that parse SOAP requests, which requires getting the entire content of the request. The code I use looks like: if request.has_key('BODY'): doc = context.REQUEST['BODY'] ___/ / __/ / ____/ Ed Leafe Linux Love: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
participants (5)
-
Andreas Jung -
Dieter Maurer -
Ed Leafe -
Frédéric LEMAITRE -
Fr�d�ric LEMAITRE