I am looking at an example that accepts files via an upload form. It inserts the file into the database while simultaneously writing it to the uploads directory with a unique name. The specific line of code that I want to copy is: db.allfiles.insert(filename=filename,filepath=filepath,parentpath=parentpath, \ filetype=filetype,file=db.allfiles.file.store(file.file,filename),datecreated=now,user=me)
I added some debug that shows file.file is <open file '<fdopen>', mode 'w+b' at 0x02970AD0> I have a separate function that accepts a string from a user, which I want to write as a file that I can insert into the database using a unique name. How can I do this? I haven't had much luck creating an open file <fdopen>. Can anyone shed any light? Thanks

