943,778 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1238
  • Java RSS
Mar 6th, 2008
0

problem in opening a file with application using java

Expand Post »
hi all,
i am trying to open a file with application using java. i faced many problems while processing it.

1. Using Runtime.getruntime.exec(); i faced the problem. i can open a file with application in the local system(server) where i have written the program. while by using the ip address i am accessing the program from local system(server). here the file with application open in that local system(system) only where the program code is.

2. using Response.setcontent(); here the file is downloading to the temporary folder and then opening but i need to open directly from the location.

3. using Javascript. here the program is running properly when outside the tomcat (webapps) folder but when i try to run using tomcat it throws an error " Activexobjects could not be supported".

see, i used three ways but i cant able to attain my expectation. so please help me for this problem.
i have to open a file with application directly from the specified location using java. pls help me by giving some solutions.
Advance thanks....
Similar Threads
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007
Mar 7th, 2008
0

Re: problem in opening a file with application using java

*sigh*
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Mar 7th, 2008
0

Re: problem in opening a file with application using java

what is *sigh*
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007
Mar 7th, 2008
0

Re: problem in opening a file with application using java

hey masijade do u know the solution for this.. reply pls
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007
Mar 7th, 2008
0

Re: problem in opening a file with application using java

I know there isn't one, since what you want doesn't work the way you want it to, and you've been told that a million times.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Mar 7th, 2008
-1

Re: problem in opening a file with application using java

k u tell how to do i will follow u. can u help pls.pls pls
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007
Mar 7th, 2008
0

Re: problem in opening a file with application using java

Then listen when he tells you that you CANNOT DO what you have been trying to do. You have been told this in many posts before in the many threads you have created on this same topic.

Get it through your head - You can't do this, so quit asking
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Mar 10th, 2008
0

Re: problem in opening a file with application using java

ok i wont ask here after. i have one small doubt for what purpose this website daniweb.com is created.

if no one knows the solution for my problem means why u r replying me harshly. so mind ur own buisness if u have no idea for my problem. kkkkkkk...
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007
Sep 15th, 2010
0

Logic to Open File using Java code

Hy hidash_in
I didn't get the exact Idea what u wanna say.
But as I understand, I think u want to open a file using Java code.
I m trying to write a code, It works well on my PC, I hope it'll be useful for u.
Java Syntax (Toggle Plain Text)
  1. public class OpenFileUsingJava
  2. {
  3. public static void main(String[]args)
  4. {
  5. try
  6. {
  7. //Path for file that you want to open (it doesnt work well for Folder every tym)
  8. String a="c:\\a.txt";
  9. Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL \""+a+"\"");
  10. }
  11. catch(Exception exception)
  12. {
  13. exception.printStackTrace();
  14. }
  15. }
  16. }
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ankurgecr is offline Offline
5 posts
since Sep 2010
Sep 15th, 2010
0
Re: problem in opening a file with application using java
No, that is not what he was asking - two years ago by the way.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: open local folder with a jButton
Next Thread in Java Forum Timeline: Need Help With If Statement (HW)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC