Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get the complete file path in Mozila

 
gangadhar Kurra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am unable to get complete file path while using Mozila but i can able to get the path in IE. can some one help me how to get the file path using using java script.

am using <input type="file" name="test">

Thanks.


 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not get the full path in modern day browsers due to security reasons.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having your web apps rely upon bugs in IE is not a good approach. Why do you need the full path? I suggest re-thinking your approach.
 
gangadhar Kurra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear & Eric.

Good to see Immediate response.

We are using DFS(Documentum Foundation Services) calls for uploading the Documents to the Documentum Server (EMC product). Using Oracle ADF screens.

In service calls it was expecting file path as argument. In ADF we have one component <af:inputFile> I was not seen any method to get the file path. For that we are writing file into the temporary path. That temporary path we are passing argument. For small files it was very fast but large files it was causing big performance issue.

instead of going input fie ADF componet. i tried following ways.

1 java script:
<input name="optionalFile" type="file" id="sample"></input>
var test=document.getElementById('sample').value;

output: document name

2. through backing bean
FacesContext fctx = FacesContext.getCurrentInstance();
HttpServletRequest rq = (HttpServletRequest)fctx.getExternalContext().getRequest();
String filename=rq.getParameter("optionalFile");

output: null


can you suggest me some solution how to get the file path. please dont suggest post ADF forum or Documentum forum



 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript and HTML will not give you the full path so there is nothing you can do on the clientside to get it. You might have to go applet/flash solution if you really need it, or you force people to type the path into a textbox OR you figure out some solution where you do not need the path .

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, is the file path on the client really what you need or where the file is uploaded to the server?
 
gangadhar Kurra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Againe Thanks Eric & Bear.

Existing Model:

In ADF file component I will get the InputStream that we are writing into temporary file in the Application Server
UploadedFile file=(UploadedFile)valueChangeEvent.getNewValue();
file.getInputStream();

In Documentum Server to create any document i need to pass as Content class Object as parameter. i was not seen any method to pass inputstream directly. it looks path for the file.

public FileContent(String localpath,String format)

in this model it causing big big perfromence issue. Desktop->Application Server->Documentum Server instead of creating file in application server. if i know the path i can directly pass the path to my Service.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic