it's a matter of "precedence"..... there's a clean section on the book on 
how to do it

http://web2py.com/books/default/chapter/29/06?search=More+on+uploads

PS: you're importing populate from gluon.contrib but not using it: are you 
sure you need it ?

On Friday, April 19, 2013 9:44:25 AM UTC+2, 黄祥 wrote:
>
> hi,
>
> i've made comparison for populate upload field type which is test1 doesn't 
> store it in blob type field and test2 store it in blob type field
> the result is test1 success to save the image file, but not in the test2, 
> it return <NULL> in shell and return None in Database Administration.
> is it possible to populate upload field type and store it in blob type 
> field? 
>
> e.g.
> models/db.py
> db.define_table('test1', 
>     Field('image', 'upload'))
>
> db.define_table('test2', 
>     Field('image', 'upload', uploadfield = 'image_data'),
>     Field('image_data', 'blob'))
>
> from gluon.contrib.populate import populate
> if db(db.test1).isempty():
>     db.test1.insert(image=open('/home/stifank/Desktop/test1.png'))
>
> if db(db.test2).isempty():
>     db.test2.insert(image=open('/home/stifank/Desktop/test1.png'))
>
> any ideas, hints, or solutions to populate upload field type and store it 
> in blob type field?
> thank you very much
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to