• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Browser Support to open a file by clicking on filename

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Here is my code to open file by clicking on filename.




Now my problem is when clicking on link to open pdf/text/image files in new window it working fine for firefox.but in IE it showing open/save dialogbox when opening file.
can anyone help me what changes need to do to open file directly in new window by clicking on filename.

Thanks..
 
SaiManasa Dasari
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i give like

its working in IE also.but documentdownload.jsp is opening again in new window.how to prevent opening new jsp again.can anyone please help me.

I tried also.its opening new blank window.without opening new blank window how to get work this?please reply me...
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If You want to open a file then simply you can execute a command from your java program to open that file.

if you want to get the file abc.pdf opened, You can use the following command...

String command = "abc.pdf";
Process child = Runtime.getRuntime().exec(command);

Before you are using this command set the path of the file....in command line with your java program like

if the file is in "c:/My Files/abc.pdf" then
String command = "cd c:/My Files";
Process child = Runtime.getRuntime().exec(command);

 
Marshal
Posts: 67340
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

narayana Ega wrote:If You want to open a file then simply you can execute a command from your java program to open that file.


Except that this is in a web app and Java isn't useful for doing anything on the client unless it's an Applet.
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!