Sorry, Im Noob. Why don“t work? The message in firefox its "not found".
import web
urls = ('/upload', 'Upload')
class Upload:
def GET(self):
return """<html><head></head><body>
<form method="POST" enctype="multipart/form-data" action="">
<input type="file" name="myfile" />
<br/>
<input type="submit" />
</form>
</body></html>"""
def POST(self):
x = web.input(myfile={})
web.debug(x['myfile'].filename) # This is the filename
web.debug(x['myfile'].value) # This is the file contents
web.debug(x['myfile'].file.read()) # Or use a file(-like) object
raise web.seeother('/upload')
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---