Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <h:inputFile id="inputFile"
  2. label="file1"
  3. value="#{controller.part}"
  4. required="true"
  5. requiredMessage="File not selected !!">
  6. </h:inputFile>
  7.  
  8. String header = part.getHeader("content-disposition");
  9. String[] headerArray = header.split(";");
  10.  
  11. for (String str : headerArray) {
  12. if (str.trim().startsWith("filename")) {
  13. path = str.substring(str.indexOf('=') + 1).trim().replace(""", "").trim();
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement