That 'example' isn't work too(((. Can anyone advice how can I insert data
in blob field.
There are one interesting thing. This code is working.
db_xml.define_table('bin_files',
Field('id','integer'),
Field('PARENT'),
Field('SRC_FILENAME'),
Field('DATA', 'blob'),
primarykey=['id','PARENT'],
migrate=False
)
load_img = db_xml.bin_files.insert(PARENT=entrant_id[0][0],SRC_FILENAME=i.
file,DATA='something')
After this transaction I see 'c29tZXRoaW5n' in database - great!
But when I trying load file it's don't work!
filepath = os.path.join(request.folder,'uploads')
img = db_app(db_app.doc_images.person=='{0} {1} {2}'.format(session.abit_f,
session.abit_i,session.abit_o)).select()
for i in img:
stream=open(filepath + '\\' + i.file, 'rb')
load_img = db_xml.bin_files.insert(PARENT=entrant_id[0][0],SRC_FILENAME=
i.file,DATA=stream.read())
Maybe anyone using Firebird 2.5 or have the same problem? Please, help.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.