def file_app(self, filepath): with open(filepath, 'rb') as fi: for b in httputil.file_source(fi): yield b
def on_body(): with open(filename, 'rb') as fi: for d in httputil.file_source(fi): yield d