Open PDF in Adobe Reader, not in the browser

advertisements

when clicked from a link on an email, the following code causes a PDF document to open in the browser:

Response.ContentType = mime;
Response.WriteFile(path);
HttpContext.Current.ApplicationInstance.CompleteRequest();

Is there any way to force the client to open it natively in the Adobe Acrobat/reader?


How the client behaves depends on several things including client-side settings... you could try this

Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment; filename="+filePath);
Response.WriteFile(path);
HttpContext.Current.ApplicationInstance.CompleteRequest();