not if file is a open('filename','rb')

On Feb 21, 6:26 pm, villas <villa...@gmail.com> wrote:
> @MrFreeze Thanks for your suggestion, but unless Web2py allocates the
> filename then the default download action will not work.
> I finally got it working after eventually finding this snippet:
>
> >>> db.yourtable.insert(yourfield=db.yourtable.yourfield.store(open(filename,'rb')))
>
> My solution is to save the thumbnail to a temp.jpg file and then use
> the 'store' function to slot it into the system. It's probably a long
> way around, but it worked,  after one last obstacle...
>
> ---------------------
> @Massimo. Please take a look at sql.py 2611,  this code:
>
>     def store(self, file, filename=None, path=None):
>         if not filename:
>             filename = file.filename
>
> If you do not supply a filename,  you get an exception:
> <AttributeError: 'file' object has no attribute 'filename'.>
> Looks like a bug?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to