0

I am using PrimeFaces 6.1 in my prject and implemented UploadedFile as described in PrimeFaces showcase and evreything works fine (I can upload and download the file as I wish) except the fileName.

e.g. when I try to upload the file from following path :

C:\Users\me\Documents\test.txt

and in Java code I try to get the fileName as follow:

FilenameUtils.getName(uploadedFile.getName());

the uploadedFile.getName() returns this string "C:UsersmeDocumentstest.txt" The whole path with out "" included drive Name! I did not override any classes and I did not change any functionality as well!

Does anyone have any idea how can I fix it?

regards Sara

noName
  • 133
  • 1
  • 12
  • Can you post the code of your page(xhtml + view + model)? – WoAiNii Jun 21 '21 at 17:28
  • 2
    Does this answer your question? [ for IE gives full path, need file name only](https://stackoverflow.com/questions/2200100/input-type-file-for-ie-gives-full-path-need-file-name-only) – Jasper de Vries Jun 22 '21 at 14:30
  • Thank you so Mach it was the problem .... the IE returns the full path however the Firefox and chrome return only the file name. @Jasper de Vries – noName Jun 23 '21 at 16:57

0 Answers0