pdf dowload

G

Guest

Hello all,
i have a asp.net c# web app 2.0

I have a pdf generation with a third part sw, but i cant download pdf in a
new window, from a folder inside my web site.
The code i try to use is this:
...pdf Generation..

Response.Clear();
Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;
filename=test.pdf");
Response.TransmitFile(@"c:\\...path..test.pdf");

pdf tell me that cannot find the file or is corrupt. I tryed the option
inline instead of attachment but nothing changed.

Anyone have some help? Thanks a lot
 
W

Winista

r u getting this error on server side or on client side when user tries to
open the downloaded content.
 
G

Guest

Thnks for responding...
I passed by opening a new window and then open the pdf directly in that
window...so the dialog mode OPEN/SAVE/CANCEL doesen't appear, but it work
fine.
This is the code:
ASPX
<script language="vbscript" type="text/vbscript">
sub NewWindow()
window.open("PDF.aspx")
end sub
</script>
<input type="button" onclick="NewWindow()" class="button"
causesvalidation="false" value="Dowload"/>

C# code behind
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.Clear();
Response.TransmitFile(PATH...);
Response.End();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,808
Messages
2,569,686
Members
45,452
Latest member
AmberLayde

Latest Threads

Top