..maybe there is a way to insert the file without using the DAL
wrapper from web2py?

On 4 Maj, 09:28, Fredrik <[email protected]> wrote:
> Hi,
>
> we're trying to use web2py to upload a binary file to a MySQL
> database. After reading some examples we landed on this table
> defenition:
>
> ts_db.define_table('firmwares',
>         Field('file', 'upload', uploadfield='file_data'),
>         Field('file_data','blob', default=''),
>         Field('crc', 'integer'),
>         Field('softwareRevisions_id', 'integer'),
> )
>
> This works perfectly with SQLForms for uploads, but web2py seems to
> store the file base64 encoded. Is there any way to avoid this? Since
> the file is later fetched by another application it's a little extra
> hassle to base64 decode the file. The best solution would be to tell
> web2py to store the file in raw format.
>
> Best regards
> Fredrik

Reply via email to