<s> from itty import * <EOL> @ get ( '<STR_LIT>' ) <EOL> def upload ( request ) : <EOL> return open ( '<STR_LIT>' , '<STR_LIT:r>' ) . read ( ) <EOL> @ post ( '<STR_LIT>' ) <EOL> def test_upload ( request ) : <EOL> myfilename = '<STR_LIT>' <EOL> if request . POST [ '<STR_LIT>' ] . filename : <EOL> myfilename = request . POST [ '<STR_LIT>' ] . filename <EOL> myfile_contents = request . POST [ '<STR_LIT>' ] . file . read ( ) <EOL> uploaded_file = open ( myfilename , '<STR_LIT:w>' ) <EOL> uploaded_file . write ( myfile_contents ) <EOL> uploaded_file . close ( ) <EOL> html = """<STR_LIT>""" % ( request . POST . get ( '<STR_LIT:foo>' , '<STR_LIT>' ) , myfilename ) <EOL> return html <EOL> run_itty ( ) </s>
