views:

15

answers:

0

I have an application, what uses wsgi as middleware, everything it's ok, with the Get but, in the POST using a form i am facing a big problem, i don' t find nothing, no matter what i make theenviron['CONTENT-TYPE'] give me this:multipart/form-data; boundary=---------------------------8753104564381071051372446876, the cgi.FieldStroage give me this:FieldStorage(None, None, []), i can't use a framework because the system has a particular way to recibe and send the data. BTW: I am using Py3k. Here the code

'''
Created on Jan 11, 2010

@author: hidura
'''
#Import Area
import sys
import cgi
import cgitb
cgitb.enable(display=0, logdir="/home/hidura")

def application(environ, start_response):

    status = '200 OK'

    location = environ['DOCUMENT_ROOT'] +"/"#Creating the string of the Suite location 

    pg_location = location+'/driver/py-postgresql-1.0.0/' #Creating the location of the DB Drivers.

    if location not in sys.path: 
        sys.path.append(location)
    if pg_location not in sys.path:
        sys.path.append(pg_location)

    print(cgi.FieldStorage())
    #Importing the Python Apps
    from wsgi.Utilities import assistant
    from wsgi.Utilities import buildRq
    buildReq = buildRq()


    response = assistant(buildReq.extrctEnv(environ, location))#Here the assistant takes the parameters and begins the work

    responseData = response.result()#Here obtaining the result of the assistant

    #responseData = "<h1>App under Development!</h1>"

    response_headers = [('Content-type', 'text/html'),
                        ('Content-Length', str(len(responseData)))]#Creating the Header of the data
    start_response(status, response_headers)#Sending the Header of the data

    return (responseData)#Returning the data to the web page.