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) {
          ;
    }
});

when i click the relevent button, the network condition is:

<https://lh3.googleusercontent.com/-QO7eLV66DOM/U1iEpRr1PRI/AAAAAAAABA0/9_p4Q3gb3-c/s1600/t.jpg>

but i don't get the browser's “Save as...” dialogue as the django document 
said.

the next time, I use the original code snippet in the document as the views 
of /orderplace/ request, but still can't get the "Save as..." dialogue

where the problem is ??

-- 
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/bf9d7939-dae6-4c88-8b1e-7a001da0442c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to