Search code examples
jsfprimefacesapache-commons-fileupload

PrimeFaces FileUpload set default path to Import file


We’re using PrimeFaces (mode="advanced") File upload component to perform server side file uploads.

Is there any way to set default path (import file path ) on choose button ? Like C:\Files\ enter image description here


Solution

  • In short, you can't.

    In long format: From my understanding, your question is related to the to <input type="file" /> topic and the browser only can remembered the last path you used for uploading something, which is our situation (photo uploading) is more than sufficient.

    Plus, when I faced your issue, I reached BalusC's answer which I wholeheartedly agree. As an user, you usually want to avoid having a website knowing your folder hierarchy.

    If you wish to read more about this, there is a wonderful answer here