Ejemplo n.º 1
0
def PostFunction(funcion):
    datos = request.body
    resp = PostServer(funcion, datos.buf)

    par = request.query.decode()
    if "pagina" in par:
        pagina = par["pagina"]
    else:
        pagina = ""
    if funcion!="RegistraUsuarioPorPagina()":  
        NodoRuta(funcion, request, pagina)

    if request.POST.get('callback'):
        return request.POST.get('callback') + "(" + resp.decode('iso-8859-1')  + ")"
    else:
        return resp
Ejemplo n.º 2
0
def PostFunction(funcion):
    datos = request.body
    print(datos.buf)
    print(type(datos.buf))
    print()
    resp = PostServer(funcion, datos.buf)

    par = request.query.decode()
    if "pagina" in par:
        pagina = par["pagina"]
    else:
        pagina = ""
    if funcion != "RegistraUsuarioPorPagina()":
        NodoRuta(funcion, request, pagina)

    if request.POST.get('callback'):
        return request.POST.get('callback') + "(" + resp.decode(
            'iso-8859-1') + ")"
    else:
        return resp
Ejemplo n.º 3
0
def uploadlogo():
    id = request.forms.get('email').split('@')[0]
    upload = request.files.get('uploadfile')
    if upload:
        name, ext = os.path.splitext(upload.filename)
        ext = ext.lower()
        filename = '/var/www/pedi/public_html/tmp/' + name + '-' + id + ext
        with open(filename, 'wb') as open_file:
            open_file.write(upload.file.read())

    datos = {}
    datos['filename'] = filename
    funcion = "SubeArchivoP('%s', '%s')" % (request.forms.get('email'),
                                            request.forms.get('clave'))
    resp = PostServer(funcion, json.dumps(datos))
Ejemplo n.º 4
0
def uploadfile():
    upload = request.files.get('uploadfile')
    num = request.forms.get('num')
    if upload:
        name, ext = os.path.splitext(upload.filename)
        ext = ext.lower()
        filename = '/var/www/juri/public_html/tmp/' + name + ext
        with open(filename, 'wb') as open_file:
            open_file.write(upload.file.read())

    datos = {}
    datos['filename'] = filename
    datos['num'] = num
    funcion = "SubeArchivo()"
    resp = PostServer(funcion, json.dumps(datos))

    if request.POST.get('callback'):
        return request.POST.get('callback') + "(" + resp + ")"
    else:
        return resp