Hi,
I am calling a [WebMethod] with a piece of JQuery. The aim of the following code it to sent a recently zipped file to the user's browser. When the user clicks the 'Download' button, an AJAX request is sent to the ASP.NET page with is supposed to send the zip file.
Here is the code.
[WebMethod]
public static void DownloadAlbum(string folderToDownload)
{
string archiveDir = "";
...some code...
HttpContext.Current.Response.ContentType = "application/zip";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + path);
HttpContext.Current.Response.TransmitFile(path);
HttpContext.Current.Response.End();
}
When this runs, nothing is sent to the browser, but no exceptions are thrown either. I'm unsure as to what is going on and why the file is not downloading.
The 'path' DEFINATELY has the correct address, and when the address of the file is hard-code the same happens.
Any help would be greatly appreciated!
Thanks,