on 05-02-2007 7:46 PM
Hi All,
Is there any way to get the entire client path of the file being uploaded using file upload UI.
I need to get the path from the client machine as, <b>D:\Folder_A\File.doc</b>.
Thanks
Sandip
Sandip,
This is totally impossible for Web applications (not only WD, any Web applications) due to security restrictions -- full path on client computer is very security sensitive information.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sandip,
Actually, I see only two options:
-- let user to select file via applet (i.e. use AWT or Swing FileChooser) - anyway you have to sign applet to let it read file, so using FileChooser shouldn't be a problem
-- don't use WD but rather use your custom WAR application with HTML (example below) and servlet that processing result:
<html>
<body>
<form action="servlet-url" method="POST"
onsubmit=
"this.fileName.value = document.getElementById('inFile').value;">
<input type="hidden" name="fileName" />
<label for="inFile">Select file:</label><input type="file" id="inFile" />
</form>
<!-- REMOVE THIS, ONLY FOR TESTING -->
<button onclick="alert(document.getElementById('inFile').value)">Clcik</button>
</body>
</html>
onsubmit script stores name of select file into hidden variable accessible as request parameter in servlet. Btw, file itself should not be transfered in example above, to transfer content as well (if you really need it) replace <input type="file"... with <input name="inFile" type="file".. -- i.e. assign name to control
Valery Silaev
SaM Solutions
Message was edited by:
Valery Silaev
Message was edited by:
Valery Silaev
I why dont you just use the upload element with its file picker then you will have the file content in the web dynpro context and can manipulate it the way you want. We use this techinque to go through/parse .xml files and copy text receipt files to be stored in CMS system. Think you might be thrashing against the framework by trying to specifically get at the full path name?
Hi Steven,
Basically my the Web DYnpro application is not in file content manipulation. It just need to get the file and pass the file path to an applet, which is a client side plug in. This applet is going to do it's on operation with the file.
So thats why I am not interested in the file content as of now. Is there a way to do this?
Regards
Sandip
Sandip,
Sorry, I have not used the in file Uploader in this capacity to get a full file name. I have used it to uploaded a client file and then copied it to an in house server so that another system can read the file and manipulate it. I would have to experiment myself to see if there is a way to do it as you are describing, I do not know of any techinque off hand.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.