Simeon
Simeon

Reputation: 7792

How to get path of uploaded file in Prime Faces?

I have this method which handles a file upload:

public void upload(FileUploadEvent event) {
    // things
}

I need to show the local path of the file that the user is trying to upload. Is there a way to get it through the FileUploadEvent object (or from somewhere else) ?

Thanks.

Upvotes: 2

Views: 5252

Answers (1)

BalusC
BalusC

Reputation: 1109745

This information is due to W3 HTML security restrictions not available in the server side. Only poor browsers like MSIE may include the path in the file name, but this should be trimmed off by your application.

You should not be interested in the path of the uploaded file, but only in its content and maybe filename.

See also:

Upvotes: 4

Related Questions