import ghttp

def wrapper(serv, addr):
    question, data, headers = serv.read()
    path, args = ghttp.parsearg(question[1])
    if question[0] == 'POST' and path:
        with open('uploaded.txt', 'wb') as f:
            f.write(data)
        serv.send(b'Uploaded!')

ghttp.server(wrapper)