It's possible to get only name of the file. The only browser actually which allowed to get the full path was IE. But starting from 8 versions it's also not reveals the full local path according to scpecification. So it's not related to upload component itself.
Please try this,
item = event.getUploadItem();
filePath = item.getFileName();
Thanks for the reply Ilya. But i have to design UI such tat a user can select a path i mean a directory path where he needs to store his data. Is there any component to it in RichFaces? or any other way of doing it
filePath = item.getFileName(); will give just the file name,but i want the complete path( absolute path).
Is there a way to get it?
I do not clearly understand how the placement of file on server (where it will be actually stores) corresponds with local path from where it was uploaded... :/
And again Chrome and Firefox never returned local path. Only file name. And IE does but starting from 8 version it returns c:\fakepath\ so you will not be able to get something usefull anyway.
Just try to get the current value from simple HTML input type="file" using java script and you will see what I mean.
Thanks Ilya, i have tried tat i got some temp path.
My problem gose like this.
1) A user selects a directory in his local machine, say D:\abc. this folder abc needs to be converted into abc.zip or abc.tar and uploaded into remote server.
2) A user selects a directory in his local machine, say D:\myFiles, where files will be downloaded to tat location.