Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Parse multiform post request
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Yang Yang  
View profile  
 More options Sep 1 2012, 8:23 am
From: Yang Yang <comety...@gmail.com>
Date: Sat, 1 Sep 2012 05:23:00 -0700 (PDT)
Subject: Parse multiform post request

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Lambacher  
View profile  
 More options Sep 3 2012, 12:57 pm
From: Chris Lambacher <ch...@kateandchris.net>
Date: Mon, 3 Sep 2012 12:56:58 -0400
Local: Mon, Sep 3 2012 12:56 pm
Subject: Re: Parse multiform post request

Hi,

I think you are looking for request.body or request.body_file:
http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/web...

-Chris

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yang Yang  
View profile  
 More options Sep 5 2012, 1:21 am
From: Yang Yang <comety...@gmail.com>
Date: Tue, 4 Sep 2012 22:21:19 -0700 (PDT)
Local: Wed, Sep 5 2012 1:21 am
Subject: Re: Parse multiform post request

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »