If you have a a generic view of a {{=response.toolbar()}} than the view 
will be embedding everything in the form, including the form.vars, into the 
html. Otherwise this should not be a problem. 

Massimo

On Friday, 15 March 2013 20:16:07 UTC-5, Vincenzo Ampolo wrote:
>
> On 03/15/2013 05:27 PM, Vincenzo Ampolo wrote: 
> > 
> > What am I doing wrong ? 
>
>
> It seems that the problem was that i was returning dict(form=form) all 
> cases, this means to send the file back to the browser (probably). 
>
> I've solved like this: 
>
> def index(): 
>      form = SQLFORM.factory( 
>          Field('archive', 'upload', 
>                uploadfolder='/tmp'), 
>          Field('operation', 'string', 
>                requires=IS_IN_SET(('search', 'add')), 
>                widget=SQLFORM.widgets.radio.widget, 
>                default='search')) 
>      if form.process().accepted: 
>          session.original_filename = request.vars.archive.filename 
>          session.local_filename = form.vars.archive 
>          redirect(URL('done')) 
>      return dict(form=form) 
>
> def done(): 
>      response.flash = 'File uploaded' 
>      print session.original_filename 
>      print session.local_filename 
>      return dict() 
>
> -- 
> Vincenzo Ampolo 
> http://goshawknest.wordpress.com/ 
> http://vincenzo-ampolo.net/ 
>

-- 

--- 
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.


Reply via email to