0

i tried so to get uploaded file absolute path but i didn't find a solution : i know that i can't get the uploaded files absolute client side path. Limitation of the browser since that is considederd a security risk. so if i use p:uploadeFile simple mode :[ http://www.primefaces.org/showcase-labs/ui/fileUploadSimple.jsf][1]

It will be an inputText field containing the absolute path of the selected project so can i retrieve it in my managed bean before clicking on the submit button (i mean uploading the file to the server the file to server )

<p:fileUpload value="#{fileUploadController.file}" mode="simple"/> <p:commandButton value="Submit" ajax="false" actionListener="#{fileUploadController.upload}"/> 

And many thanks

1 Answer 1

3

You can't. Some older browsers with security bugs may give you the full path on HtmlInputElement#value in JavaScript, but all modern browsers only give the base filename back and others even prepend it with a fake path such as c:\fakepath in IE and Webkit browsers.

You shouldn't be interested in this information anyway. This is completely irrelevant to any self-respected business logic processing an uploaded file. Whatever functional requirement you thought to solve with this has to be solved differently.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.