On a second look. I think you are trying to upload multiple files in
the same upload field. This is not possible. Each upload field must
point to one file.

On Apr 13, 6:06 am, npsads <nps...@gmail.com> wrote:
> Hi
> I'm web2py newbie.
> Can anybody show me example how to use jquery.multifile in web2py ?
> This is my code:
> def add():
>     form=SQLFORM.factory(
>         Field('description'),
>         Field('atachment','upload',label='Załączniki'))
>
>     if form.accepts(request.vars, session):
>         response.flash = 'Ok'
>     elif form.errors:
>         response.flash = 'Error'
>     else:
>         response.flash = 'Input'
>     return dict(form=form)
>
> jguery.mulitfile is set  for class "upload" . Every time when i try to
> send form with more then 1 atachment i got error
>
>  File "C:\Documents and Settings\wisnia\Pulpit\W2P\gluon\sqlhtml.py",
> line 947, in accepts
>     newfilename = field.store(source_file, original_filename)
> UnboundLocalError: local variable 'source_file' referenced before
> assignment
>
> Thanks
> Rafal

Reply via email to