Reading file content from uploaded text file
I have an uploaded file in uploads folder and i need to read the contents from it in the controller for processing it further. I have very basic knowledge of web2py and couldn't understand how to do it. Anthony You can do something like: import os filename = db.mytable(record_id).myfile content = open(os.path.join(request.folder, 'uploads', filename), 'rb').read() UPDATE: Here is a somewhat simpler approach. 来源: https://stackoverflow.com/questions/26968216/reading-file-content-from-uploaded-text-file