Could this be the best solution ? 

mysecurefilename = 
db.t_card_posting.f_destfile.store(tempfile.TemporaryFile(), 
'my_empty_file.csv')
mf = open('applications/CardPosting/uploads/' + mysecurefilename, 'w')
mf.write('This is my first test line in my empty csv file.')


Le samedi 14 avril 2012 12:51:36 UTC+2, François Delpierre a écrit :
>
> Hi,
>
> I have a table with two upload fields. I need to transform the file from 
> the first upload field, and create it in the second upload field.
> What is the best way to do it, and possibly avoid to first create the file 
> in memory before writing it to the disk.
>
> It looks like I can generate the random file name in the DB with such a 
> store command :
> db.t_card_posting.f_destfile.store(fileObject,filename)
>
> But the problem is that at this stage, I do not yet have any file object. 
>
> Regards,
>

Reply via email to