Asp.Net HttpHandler and jQuery Ajax call
These are 2 questions. The first one: I have an HttpHandler returning a zip file to download. I have this line of code:
context.Response.AppendHeader("content-disposition", "attachment; filename=myzipfile.zip");
The question is: should I declare the ContentType
(application/zip) also ?
The second question is:
I want to call this HttpHandler from a jQuery ajax call.
I send parameters in json format.
How should I declare th开发者_StackOverflowe contentType
of the ajax call?
Thanks for your time.
The question is: should I declare the ContentType (application/zip) also ?
Yes.
I want to call this HttpHandler from a jQuery ajax call
Calling a server side script that returns binary zip stream using AJAX makes little sense as you won't be able to manipulate the response.
精彩评论