Re: Parse multiform post request

67 views
Skip to first unread message

Chris Lambacher

unread,
Sep 3, 2012, 12:56:58 PM9/3/12
to pylons-...@googlegroups.com
Hi,

I think you are looking for request.body or request.body_file:

-Chris

On Sat, Sep 1, 2012 at 8:23 AM, Yang Yang <come...@gmail.com> wrote:
Hi All,

I've a multform post request look like this:

--xxxxxx
Content-Disposition: form-data; name="userfile"; filename="test.txt"
Content-Type: text/plain

Hello World

--xxxxxx--

How could I extract the "Hello world" from the request.

Thanks in advance.

best regards

Yang


--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/OqOcyXv6IZIJ.
To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.



--
Christopher Lambacher
ch...@kateandchris.net

Yang Yang

unread,
Sep 5, 2012, 1:21:19 AM9/5/12
to pylons-...@googlegroups.com
Hi Chris,

I only want to extract the "hello world" part.
I found a solution in the cookbook.

        filename = self.request.POST['userfile'].filename
        
        input_file = self.request.POST['userfile'].file

to extract the file name and input file.

best regards,

Yang
Reply all
Reply to author
Forward
0 new messages