Click here to Skip to main content
11,795,568 members (77,872 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
Response.ContentType = "Application/octet-stream"

Response.AddHeader("Content-disposition", "inline; filename=Reportname.pdf")

how to download file without ask save dialogbox?
and how to set download path of that file?
Posted 22-Sep-10 22:35pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can not skip browser's default behavior due to security reasons apply on web applications.

vote if it helps
usankardurai at 23-Sep-10 5:56am
then what i have to change in my coding
MalikRizwan at 23-Sep-10 5:58am
You don't need to change anything.. your code is alright.. its just you can not FORCE webclients to skip save window. operating system doesn't allow web applications to change native behavior of browser
usankardurai at 29-Sep-10 1:20am
Thank U Malik Rizwan.
usankardurai at 29-Sep-10 1:24am
Response.ContentType = "Application/whoispp-response"
Response.AddHeader("Content-disposition", "inline;filename=Reportname.pdf")


It is open pdf in acrobat without asking open dialog box,
but one problem arise ,that is the viewer page is shown as empty , i want to show another page , how it is possible?
MalikRizwan at 29-Sep-10 10:35am
its possible only oon client side.. probably in javascript you need to check if you can create ACTIVEX control for PDF viewer.. if it allows ..ignore otherwise redirect

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 340
1 Sergey Alexandrovich Kryukov 316
2 OriginalGriff 285
3 Abhinav S 223
4 KrunalRohit 214
0 OriginalGriff 1,797
1 Maciej Los 1,415
2 KrunalRohit 1,240
3 CPallini 840
4 ppolymorphe 808

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 23 Sep 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100