Sutabi wrote:
> *sigh* alright I fixed that error, but I know I gotta
be missing a
> function somewhere, its not able to read my session
config stuff, so I
> loaded it manually
>
> Code:
> --------------------------------------------
> if cherrypy.request.method.upper() ==
"POST":
> post = {}
> request = cherrypy.request
>
> ## Get the post
> length = int(request.headers.get('Content-length',
0))
> args = request.rfile.read(length)
> request.close()
>
> ## Sort the post arguments
> for arg in args.split("&"):
> (variable, value) = arg.split("=")
> post[variable] = value
I thought you were doing file uploads, in which case your
request body
is almost certainly going to be multipart/form-data. Here's
a sample
request for such:
POST /upload HTTP/1.1
Content-type: multipart/form-data; boundary=x
Content-Length: 116
--x
Content-Disposition: form-data; name="file";
filename="hello.txt"
Content-Type: text/plain
Hello, world!
--x--
In the real world, browsers choose a boundary much longer
than 'x', but
you get the idea. Again, I recommend you dig the cgi module
to
reverse-engineer this. My bet is that the FieldStorage
module provides
a hook for you to do this already (like make_file()?).
Robert Brewer
System Architect
Amor Ministries
fumanchu amor.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|