Thanks!
Response.ContentType="application/pdf";
Response.AddHeader( "content-disposition","attachment;
filename=filename);
FileStream sourceFile = new FileStream("C:\\PDFs\\" + filename,
FileMode.Open);
long FileSize;
FileSize = sourceFile.Length;
byte[] getContent = new byte[(int)FileSize];
sourceFile.Read(getContent, 0, (int)sourceFile.Length);
sourceFile.Close();
Response.BinaryWrite(getContent);
thanks! ...and what event would i hook this into? The goal is to let
the user click a hyperlink to open the pdf...
Jesse, use the LinkButton control to create a link, and create an
event handler for the Click event
<asp:LinkButton id="LinkButton1"
Text="Download PDF"
OnClick="LinkButton_Click"
runat="server"/>
in the code-behind
void LinkButton_Click(Object sender, EventArgs e)
{
....
}
if you are interested in consulting, i have a small project that i
could use some assistance with. let me know if you are interested:
jesse....@gmail.com