SPFile filedownload = SPContext.Current.Web.GetFile(chemin complet du fichier);
byte[] fileByte = filedownload.OpenBinary();
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;filename=" + filedownload.Name);
Response.ContentType = "application/pdf";
Response.BinaryWrite(fileByte);
Response.Flush();
Response.End();
Aucun commentaire:
Enregistrer un commentaire