• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Browser Support to open a file by clicking on filename

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);

 
Sheriff
Posts: 67735
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Everybody! Do the Funky Monkey! Like this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic