from mod_python import apache,util,psp import os __here__ = os.path.dirname(__file__) def index(req): req.content_type = 'text/html' tmpl = psp.PSP(req, filename=os.path.join(__here__,'template.tmp')) html = """
""" tmpl.run(vars={'QUOTE':""}) return apache def ajax(req, test='1212'): req.content_type = 'text/html' req.write(test) return apache def upload(req): req.content_type = 'text/html' files = req.form['fileupload'].file filename = req.form['fileupload'].filename upload_dir = "/var/www/wirusoal.ru/web/download" fout = file(os.path.join(upload_dir, filename), 'wb') while 1: chunk = files.read() if not chunk: break fout.write(chunk) fout.close() req.write(os.path.abspath('')) return apache