Click here to Skip to main content
15,886,872 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

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

vote if it helps
 
Share this answer
 
Comments
sankar guru 23-Sep-10 5:56am    
then what i have to change in my coding
?
MalikRizwan 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
sankar guru 29-Sep-10 1:20am    
Thank U Malik Rizwan.
sankar guru 29-Sep-10 1:24am    
Response.ContentType = "Application/whoispp-response"
Response.AddHeader("Content-disposition", "inline;filename=Reportname.pdf")

Response.BinaryWrite(bytes)
Response.Flush()


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 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900