blob field

19 views
Skip to first unread message

KevC

unread,
May 21, 2015, 11:27:30 AM5/21/15
to web...@googlegroups.com
Hi! I have a problem while I wanna download a file from database. I dont wanna save the file in the folder 'uploads', I wanna save it in my database. I use this example.

db.define_table('libro',
    Field('titulo','string', requires=IS_NOT_EMPTY(error_message='Introduzca título'),label='Titulo'),
    Field('archivo','upload',uploadfield='archivo_bd, label='Archivo .PDF',  requires= IS_UPLOAD_FILENAME(extension='pdf',error_message='Archivo invalido')),
    Field('archivo_bd','blob'),
    Field('hecho_por',db.auth_user,default=auth.user_id, writable=False,readable=False)
)

I do a clic on the link and the file download but, I wanna open the file but the message says that file is damage or extension not compatible. Why?


My best regards.
Reply all
Reply to author
Forward
0 new messages