it's no problem.i try to run like this: # python xxx.py and open web browers,input: http://127.0.0.1:8080/upload it's ok. ------- http://twitter.com/smallfish_xy http://hi.baidu.com/smallfish_xy http://www.douban.com/people/smallfish.xy/
2009/7/3 ser cam <[email protected]> > 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 -~----------~----~----~----~------~----~------~--~---
