asp.net - pdf will load if use 'save link as' but not if user clicks on the link -


After submitting a form, the user has been presented with a link to a PDF document. The link is directly on the document, it is not streamed.

If the user right-clicks and 'saves the link this way,' then the document saves and opens properly, however, if the user clicks on the link, then to respond to the browser It takes a lot of time (I'm guessing that this is 3 minutes) and then Adobe Reader returns the following error:

"File is damaged and can not be repaired"

It is in Chrome v5, ASP.NET 3.5 and the link is an UpdatePan Is back inside of the cell.

It depends on the browser settings that is configured for PDF links. If you have settings in Browzer If you change, you will receive the download dialog.

Mozilla Firefox

  1. Open Mozilla Firefox
  2. Click on Tools and then Options
  3. In the Options window, click the App
  4. Select the type of content you want to adjust. For example, if you want to change that the PDF file opens in Firefox, select the Adobe Acrobat document.
  5. In the action section, take action on how to open the file, take action on how to open the file. if you. If you want to download PDF files instead of opening it, select Save File.
  6. Internet Explorer:

    You have to right click

      Private zero page object (object sender , System.EventArgs e) {// Set the appropriate ContentType Response.ContentType = "Application / PDF"; // Find the physical path in the file. String file path = mappath ("Acrobat PDF"); // file directly into the HTTP content output stream. Response.WriteFile (FilePath); Response.End (); }  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -