Browse files

sorry, haven't noticed tutorial is for webpy3...

  • Loading branch information...
1 parent 949246b commit e9e98fcc5c4333400c1ff973664489408af70141 Val-Amart committed with anandology Aug 25, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 cookbook/fileupload.md
View
7 cookbook/fileupload.md
@@ -17,7 +17,7 @@ File uploads can be a little tricky if you're not familiar with form uploads, or
class Upload:
def GET(self):
- print """<html><head></head><body>
+ return """<html><head></head><body>
<form method="POST" enctype="multipart/form-data" action="">
<input type="file" name="myfile" />
<br/>
@@ -29,11 +29,12 @@ File uploads can be a little tricky if you're not familiar with form uploads, or
x = web.input(myfile={})
web.debug(x['myfile'].value) # This is the file contents
web.debug(x['myfile'].filename) # This is the filename
- web.seeother('/upload')
+ raise web.seeother('/upload')
if __name__ == "__main__":
- web.run(urls, globals())
+ app = web.application(urls, globals())
+ app.run()
## Hang ups

0 comments on commit e9e98fc

Please sign in to comment.