Re: [web2py] calling download function page by ajax

2014-03-19 Thread Richard Vézina
I found this workaround : response.js = "window.open('%(url1)s'); window.open('%(url2)s');" % {'url1': URL(c='controller', f='func1', extension=False, vars=dict(var1=var1, **var2_dict)), 'url2': URL(c='controller', f='func2', extension=False, vars=dict(var1=var1))} As one of the suggestion of Nip

Re: [web2py] calling download function page by ajax

2014-03-19 Thread Richard Vézina
Thanks for suggestion! Richard On Wed, Mar 19, 2014 at 1:23 AM, Limedrop wrote: > Posted to soon. To clarify, the cookies need to be set in your download > function: > > {{view}} > > response.files.append(URL('static','jquery.fileDownload/jquery.fileDownload.js')) > > > > {{controller}} >

Re: [web2py] calling download function page by ajax

2014-03-18 Thread Limedrop
Posted to soon. To clarify, the cookies need to be set in your download function: {{view}} response.files.append(URL('static','jquery.fileDownload/jquery.fileDownload.js')) {{controller}} response.js = '$.fileDownload("http://127.0.0.1:8000/sgddms/label/download_func1?var1=2676&v

Re: [web2py] calling download function page by ajax

2014-03-18 Thread Limedrop
You might want to look at http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/ The only fiddly bit is to make sure you set the cookies correctly (see the documentation for details). For example: {{view}} response.files.append(URL('static','js/jque

Re: [web2py] calling download function page by ajax

2014-03-18 Thread Richard Vézina
:( I already have a workaround where I show buttons for starting download for each files that are appended on submit, but I hate that from user experience point of view... I thought about an other solution, where I could get vars values from javascritp once form is submit trought session.var but I

Re: [web2py] calling download function page by ajax

2014-03-18 Thread Niphlod
content-disposition on ajax requests is not allowed, therefore browser refuse to show the usual "download as file" dialog, plain and simple :D You need to come up with an alternative plan (such as, opening a new window pointing to the url, open a hidden iframe, using 3rd party libraries that do

[web2py] calling download function page by ajax

2014-03-18 Thread Richard
Hello, I want to call 2 functions that return a file to be upload/download into client computer... I have been able to make the first call page to upload file correctly, but I can't figure out how to make upload both files, I thought I could solve the issue with ajax call, no lock. # controlle