The field only stores the filename, not the full path, so you need to build
the path:
import os
file = open(os.path.join(request.folder, 'uploads', db.seed_file[id].file),
'wb')
Anthony
On Thursday, June 14, 2012 5:44:50 PM UTC-4, Umpei Kurokawa wrote:
>
> So I have a table in the database like this.
>
> db.define_table('seed_file',
> Field('title','string'),
> Field('file','upload'),
> format='%(title)s')
>
> And I want to open the uploaded files from this table from the controller
> for further manipulation. Using open() function on file, I get an error
> saying that it cannot find the file.
> How is this done exactly?
>