Yes I am getting that same problem here.

Like I said, I don't really know how to properly test if the variable has
been set.

Any input from more wise web2pyers would be great

Calvin


On 8 January 2014 14:03, Brando <bhe...@trustcc.com> wrote:

> Calvin, I'm getting this error when I select only 1 file to upload:
>
>
>
> Traceback (most recent call last):
>  File "/Volumes/BrandonsData/Google
> Drive/web2py/web2py.app/Contents/Resources/gluon/restricted.py", line 217,
> in restricted
>  File "/Volumes/BrandonsData/Google
> Drive/web2py/web2py.app/Contents/Resources/applications/calvinsmultiuploadfromgooggroup/controllers/default.py"<http://127.0.0.1:8000/admin/default/edit/calvinsmultiuploadfromgooggroup/controllers/default.py>
> , line 158, in <module>
>  File "/Volumes/BrandonsData/Google
> Drive/web2py/web2py.app/Contents/Resources/gluon/globals.py", line 372, in
> <lambda>
>  File "/Volumes/BrandonsData/Google
> Drive/web2py/web2py.app/Contents/Resources/applications/calvinsmultiuploadfromgooggroup/controllers/default.py"<http://127.0.0.1:8000/admin/default/edit/calvinsmultiuploadfromgooggroup/controllers/default.py>
> , line 116, in submit
>  File "cgi.pyc", line 591, in __len__
>  File "cgi.pyc", line 574, in keys
> TypeError: not indexable
>
> Which is coming from the highlighted line:
> def submit():
>   import datetime
>
>   form = FORM(LABEL("File(s):"), INPUT(_name='up_files', 
> _type='file',_multiple
> =''), INPUT(_type='submit'))
>
>
>   if form.accepts(request.vars, formname="form"):
>
>     if hasattr(request.vars, 'up_files'):
>       if len(request.vars.up_files) > 0:
>
>         files = request.vars['up_files']
>         if not isinstance(files, list):
>           files = [files]
>
>         for f in files:
>           print f.filename
>           up_file = db.uploads.up_file.store(f, f.filename)
>           i = db.uploads.insert(notes=request.vars.notes, up_file=up_file,
> filename=f.filename, username = auth.user.email, up_date= datetime.
> datetime.now())
>           db.commit()
>
>
>         return "form submitted" #redirect(URL('data', 'index'))
>
>       else:
>         form.errors.up_files = "No files selected"
>
>   return dict(form=form)
>
>
>
>
>
> Did you see that during your testing? Any thoughts on this?
>
> --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to