This line:

   ArchivoAudible = db.Archivo_grabadora.archivo.store(aux, aux.filename)

should be

   ArchivoAudible = db.Archivo_grabadora.archivo.store(aux.file, 
aux.filename)

Anyway, you cannot upload this many files. There are size limits to how 
much you can upload:

http://www.motobit.com/help/scptutl/pa98.htm

but there are issues with this design. This is a multipart file

On Saturday, 27 September 2014 11:02:59 UTC-5, Fernando Pardo wrote:
>
> Hi!
>
> I'm using Web2py to build a desktop application that will run on the 
> user's computer using the localhost. An use case involves the user 
> uploading a large number of files (about 100-200 files ranging from 5 to 30 
> MB) MB each. Here is a simplified chuck of code I'm using:
>
> ########################
> Model:
>
> Campos_Archivo_grabadora = [
>     Field('archivo_nombre_original',required=True),
>     Field('archivo','upload', autodelete=True,required=True),
>     ]
>
> db.define_table('Archivo_grabadora',*Campos_Archivo_grabadora, 
>     singular='Archivo grabadora', plurals='Archivos grabadoras')
> ########################
>
> ########################
> Controller:
>
> def index():
>
> forma = FORM(INPUT(_name='archivos_audibles', _type='file', _multiple=True,
>         requires=IS_NOT_EMPTY()))
>
> if forma.accepts(request.vars,formname='formaHTML'):
>
>         archivosAudibles = forma.vars['archivos_audibles']
>
>         if not isinstance(archivosAudibles, list):
>         
>             archivosAudibles = [archivosAudibles]
>             
>         for aux in archivosAudibles:
>
>             ArchivoAudible = db.Archivo_grabadora.archivo.store(aux, 
> aux.filename)
>             
>             datosArchivoAudible = {}
>             datosArchivoAudible['archivo'] = ArchivoAudible
>             datosArchivoAudible['archivo_nombre_original'] = aux.filename
>             db.Archivo_grabadora.insert(**datosArchivoAudible)
>     
> ########################
>
> ########################
> View:
>
> {{extend 'layout.html'}}
> <form action="" enctype="multipart/form-data" method="post">
> <input type="hidden" name="_formname" value="formaHTML"/>
>         <input type="file" name="archivos_audibles" multiple/>
> <input type="submit" value="Enviar" class="btn" id="enviar"/>
> </form>
>
> ########################
>
> However, my application does not seem to handle this correctly: spends a 
> lot of time and cpu resources, and sometimes freezes. I would like to know 
> how to solve this issue. Thank you!
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to