> But it happens that when trying to upload a file upload the following > error occurs: > > *DataError: ('22018', '[22018] [FreeTDS][SQL Server]Operand type clash: > text is incompatible with image (206) (SQLExecDirectW)')* >
This is perfectly fine. web2py adopts a convention that simplifies the code a lot when dealing with different adapters: it stores the content as a base64 encoded string into TEXT fields. No wonder that the insert fails on an "image" field. > > Then I changed the field, using one type TEXT (Archivo_Blob). The model > will now be: > > tb_documentos_blob = db.define_table('DocumentosBlob', > Field('nombre', length=50), > Field('archivo', 'upload', uploadfield='archivo_blob'), > Field('archivo_blob', 'blob', writable=False, readable=False), > migrate=False, > ) > > > > Now it works, I can upload and download files, but only with very small > files. Tested with 20KB. With one of 250KB upload it, but at download it is > broken. I imagine that was truncated when stored in the database. > > this model is correctly tied to the underlying structure (and web2py "conventions"). Read my previous post on TEXTSIZE setting throughout your middlewares. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.