Getting data from the body of a post
One of the companies working with my employer on a largish project needs to submit the contents of a file to our Zope server. Their middlewear application doesn't seem to be able to send multipart forms, so it just sticks the contents of the file into the body of the post. Is there an easy way to get at this data? I can't find the request['BODY'] attribute from inside Python scripts, so I'm at a loss for where to look. -- Kirk Strauser The Day Companies
Kirk Strauser wrote:
Their middlewear ... just sticks the contents of the file into the body of the post. Is there an easy way to get at this data? I can't find the request['BODY'] attribute from inside Python scripts, so I'm at a loss for where to look.
I've been having pretty much the same problem. There may be a better answer, but if you use an External Method there is a request.stdin which is a file-like object you can read() from. Dan. -- Dan Ellis <dan.ellis@northlindsey.ac.uk> Computer Officer, North Lindsey College 01724 294024 (ext. 4024 internally) Microsoft Certified Professional
----- Original Message ----- From: "Kirk Strauser" <kirk@daycos.com>
One of the companies working with my employer on a largish project needs to submit the contents of a file to our Zope server. Their middlewear application doesn't seem to be able to send multipart forms, so it just sticks the contents of the file into the body of the post. Is there an easy way to get at this data? I can't find the request['BODY'] attribute from inside Python scripts, so I'm at a loss for where to look.
If you print out the contents of REQUEST, does the file data should up anywhere? (if so, you should be able to do a REQUEST.get('label') where 'label' is the name of the variable that REQUEST is using to hold the data). If the data is not showing up in REQUEST then, unless you see a file upload instance referenced within the REQUEST block, you are not getting the data. Jonathan
participants (3)
-
Dan Ellis -
Jonathan Hobbs -
Kirk Strauser