Web Parts and Downloads?

Can anyone suggest a better way to suggest a file to upload to a SharePoint Web Part? The file will be dynamically created on demand, but I still need to display the standard page, as well as the downloaded file.

+3
source share
2 answers

In the end, I dynamically added an iFrame to the web part during reboot after the user selects the Export option and a standard .aspx page is loaded inside it, which handles sending. This is due to the problem of sending a response.

0
source

Microsoft .

Microsoft :

private void Page_Load(object sender, System.EventArgs e)
{
  //Set the appropriate ContentType.
  Response.ContentType = "Application/pdf";
  //Get the physical path to the file.
  string FilePath = MapPath("acrobat.pdf");
  //Write the file directly to the HTTP content output stream.
  Response.WriteFile(FilePath);
  Response.End();
}

.

0

Source: https://habr.com/ru/post/1717340/


All Articles