On Tue, Mar 26, 2013 at 6:48 AM, Larry Martell <larry.mart...@gmail.com> wrote:
> On Wed, Mar 20, 2013 at 6:26 PM, Felipe Coelho <fcoelh...@gmail.com> wrote:
>>> 2013/3/20 Larry Martell <larry.mart...@gmail.com>
>>>
>>>
>>> I'm not outputting any PDF. I have a zip file I want to download to
>>> the user's computer, and I also want my template rendered.
>>
>>
>> That means you have should have two requests, possibly processed by two
>> different views, which is what Felipe (the other one) is trying to tell you.
>>
>> You must have a view that renders your template. In the resulting page,
>> include something to trigger the file download from the other view.
>
> OK, I've implemented this using ajax as the other Felipe suggested,
> but the save as is not getting triggered on the response from the view
> invoked by the ajax call. If I invoke the same view by cutting and
> pasting the URL generated by the ajax call into my browser's address
> bar the save as is invoked, but when called from ajax it is not. Any
> idea why that could be happening?

I figured this out - instead of using ajax I just assign the URL to
location.href. Works perfectly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to