Basu Ramanan

Greenhorn
+ Follow
since Sep 14, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Basu Ramanan

David

lokesh pattajoshi wrote:Actually we have two buttons called View and Downloads of some documents if user is clicking on View than it should(only pdf docs)open in web browser and if user is clicking Download than it should be downloaded..



I think thats what Lokesh needs, by download without save/open dialog he means, view the content in web browser.
13 years ago
response.setHeader( "Content-Disposition", "attachment; filename=\"" + fileName() + "\"" );

In your above snippet, try setting "Content-Disposition" as "inline" instead of "attachment"

and do this only when you want to "View" and for "download" retain your existing code.

not sure if it will by pass the browser settings, but worth a try.
13 years ago