views:

69

answers:

1

I have an httphandler that creates a zip file and returns it for download.

context.Response.AppendHeader("content-disposition", "attachment; filename=myfile.zip");

Is it possible to call the handler from a jquery ajax call? If yes, what kind of dataType should I declare?

Thanks

A: 

What I would suggest here is not to return the ZIP file through Ajax, but create it and return a link to it (or the error message). Then you can process the response and either show the error or allow the user to download from the link.

Fosco