Miscellany
public python v1 · immutabledef checkform(): data = cgi.FieldStorage() if data.has_key("action"): if data["action"].value == "login": if data["ftpass"].value == "": return ftp_init() return ftp_init(data["ftpass"].value) elif data["action"].value == "upload": upfile = data["upfile"].file.read() outfile = open("outfile.jpg", "w") # HERE i want to have the parsed filename of the uloaded file outfile.write(data["upfile"].value)