How To Get File Path After Browsing A File In Java

How To Get File Path After Browsing A File In Java

Page 1 of 1

3 Replies - 8600 Views - Last Post: 29 July 2009 - 04:53 PM Rate Topic: -----

#1 raichursreedhar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 29-July 09

How To Get File Path After Browsing A File In Java

Posted 29 July 2009 - 04:10 AM

Can any one help me how to get file path after browsing/uploading a file in Java (excluding swings)

This post has been edited by raichursreedhar: 29 July 2009 - 04:35 AM

Is This A Good Question/Topic? 0
  • +

Replies To: How To Get File Path After Browsing A File In Java

#2 rishabhsharma  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 10
  • View blog
  • Posts: 342
  • Joined: 26-March 09

Re: How To Get File Path After Browsing A File In Java

Posted 29 July 2009 - 04:48 AM

I know its not upto your question but it might help upto some extent......

import java.io.*;
public class FilePath
	{
		public static void main()
			{
				File file = new File("fileName");
				String filePath = file.getAbsolutePath();
				System.out.println(filePath);
			}
	}



and please do not ask for codes in Dreamincode.net since it is your first post therefore I have helped you.......

This post has been edited by rishabhsharma: 29 July 2009 - 04:49 AM

Was This Post Helpful? 0
  • +
  • -

#3 NeoTifa  Icon User is offline

  • Whorediot
  • member icon





Reputation: 2636
  • View blog
  • Posts: 15,656
  • Joined: 24-September 08

Re: How To Get File Path After Browsing A File In Java

Posted 29 July 2009 - 10:12 AM

I think in Java 7 they have a path class, and you can get non-absolute paths... but that's later on.
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8327
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: How To Get File Path After Browsing A File In Java

Posted 29 July 2009 - 04:53 PM

View PostNeoTifa, on 29 Jul, 2009 - 09:12 AM, said:

I think in Java 7 they have a path class, and you can get non-absolute paths... but that's later on.

seems that Rishabhsharma already found it in 1.6 :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1