Thank you Ricardo. This helps a lot. I will fix it asap. massimo
On Saturday, 9 March 2013 10:10:19 UTC-6, Ricardo Pedroso wrote: > > On Sat, Mar 9, 2013 at 4:27 AM, Massimo Di Pierro > <[email protected] <javascript:>> wrote: > > I cannot reproduce the problem. > > I was able to reproduce it with web2py > Version 2.4.2-stable+timestamp.2013.03.09.00.16.49 > > I attach a small sample that demonstrate the issue. > Just drop the attachment in controllers in an empty > application. it does not need any view and db connection > and table definition is in it. > > > It would help if you could isolate it. Do you see the memory increase > during > > upload? After upload? During validation? After validation? When the form > is > > successfully uploaded or only when there is error in the form? Can you > > reproduce it if there is only one field? > > > > The problem is with SQLFORM.grid. > > I track it down to: > > - sqlhtml.py (1817) in def url > `- sqlhtml.py (1824) when calling URL(**b) > `- html.py (357) when calling urllib.urlencode(list_vars) > > list_vars contains the FieldStorage. So I guess the content of the upload > is used in urlencode. > > The call to url() is the culprit and it's called in two places in > sqlhtml.py: > > line 1835: > referrer = session.get('_web2py_grid_referrer_' + formname, url() > > line 1850: > def gridbutton(buttonclass='buttonadd', buttontext=T('Add'), > buttonurl=url(args=[]), callback=None, > delete=None, trap=True) > > > Ricardo > > > > On Friday, 8 March 2013 19:55:35 UTC-6, Mạnh Trần Đức wrote: > >> > >> Hi,this is my db: > >> ######################################## > >> db.define_table('clsb_product', > >> Field('product_category', type = 'reference clsb_category', notnull > = > >> True, > >> label = T('Category')), > >> Field('product_type', type = 'reference clsb_product_type', notnull > = > >> True, > >> label = T('Product Type')), > >> Field('product_relation', type = 'reference clsb_relation', notnull > = > >> True, > >> label = T('Product Relation')), > >> Field('product_creator', type = 'reference clsb_dic_creator', > notnull > >> = True, > >> label = T('Product Creator')), > >> Field('product_publisher', type = 'reference clsb_dic_publisher', > >> notnull = True, > >> label = T('Product Publisher')), > >> Field('product_title', type = 'string', notnull = True, > >> label = T('Product Title')), > >> Field('product_code', type = 'string', notnull = True, unique = > True, > >> label = T('Product Code')), > >> Field('total_file', type = 'integer', > >> label = T('Total File')), > >> Field('product_cover', type = 'upload', requires = > IS_IMAGE(extensions > >> = 'png'), notnull = True, > >> label = T('Cover Image')), > >> Field('product_data', type = 'upload', requires = > >> IS_UPLOAD_FILENAME(extension = 'zip'), notnull = True, > >> label = T('Product Data')), > >> auth.signature, > >> format = '%(product_title)s') > >> > >> this is function in controller: > >> ######################################## > >> def manager(): > >> if request.args: > >> table = 'clsb_' + request.args(0) > >> if not table in db.tables(): redirect(URL('error')) > >> form = SQLFORM.grid(db[table], args = request.args[:1], > >> onupdate = auth.archive, > >> showbuttontext = False, > >> user_signature = False) > >> return dict(form = form) > >> return None > >> > >> Thank everyone for repling me :-) > >> > >> On Friday, March 8, 2013 12:41:47 AM UTC+7, Massimo Di Pierro wrote: > >>> > >>> Can you show us your code? Web2py is transparent to the upload and > does > >>> not stores the uploaded file in ram but your app may do it and that > may be a > >>> problem. > >>> > >>> On Wednesday, 6 March 2013 20:56:28 UTC-6, Mạnh Trần Đức wrote: > >>>> > >>>> When I upload a ~400Mb file: > >>>> > >>>> Firstly, After Chrome show "upload 100%" , the python progress jump > from > >>>> 50 -. 400 MB > >>>> Then after few senconds, it jumps to max of RAM (Step by step, 1GB, > >>>> 1.5GB, ... 2.5 GB) then my PC hang (Fully of RAM) > >>>> > >>>> On Monday, March 4, 2013 7:15:55 PM UTC+7, Phyo Arkar wrote: > >>>>> > >>>>> How much Ram it takes. > >>>>> > >>>>> Wont take alot more than 400mb i believe. > >>>>> > > -- > > > > --- > > 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] <javascript:>. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- --- 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/groups/opt_out.

