On Thu, Apr 24, 2014 at 4:31 AM, 张永强 <shoumu...@gmail.com> wrote:
>
> In my program, I want to generate a pdf and output to the browser.
>
> the server end code is:
>
> response = HttpResponse(content_type='application/pdf')
> response['Content-Disposition'] = 'attachment; filename="' + orderNumber + 
> '.pdf"'
> response.write(pdf)
> return response
>
> In the code, the type of pdf is 'str'
>
> the ajax code is:
>
> $.ajax({
>     type:'POST',
>     url:'/orderplace/',
>     data:{provider:provider, providerId:providerId, orderNumber:orderNumber},
>     success:function(resultData) {
>           ;
>     }
> });

You cannot download files with AJAX. Make a regular request.

Cheers

Tom

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1JES94hqHGNkcacE65s_qAuJ6nK%3Db7gT6RaynmxeFopng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to