if you use

   form=SQLFORM(db.my_images)

or

   form=crud.create(db_myimages,formstyle='table3cols')

You do not need the manual insert. If you choose the manual insert it
should be


 
db.my_images.insert(name=[some_name],image=db.my_images.upload.store(request.vars.upload.file,request.vars.upload.filename))

This is because request.vars.upload is a stream connected to the file
to upload. The store method loads it in a temp file and returns the
new temp name for it. Only this new name gets stored in the db, not
the entire image (unless you set uploadfield='some blob field').

Massimo

On Jul 19, 9:20 am, Simone <[email protected]> wrote:
> Hi,
>
> I'm using web2py with Oracle 10 and I'm having a problem trying to
> upload a file:
>
> in db.py I have:
> db.define_table('my_images',Field('name','string'),Field('image',
> 'upload'))
>
> I have an html form whre the user chose wich file to upload. When the
> form is submitted i do the following:
> db.my_images.insert(name=[some_name],image=request.vars.upload) and
> then i got the error ORA-01704: string literal too long.
>
> request.vars.upload value is  C:\temp\a.jpg
>
> Can anybody help me??

Reply via email to