Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:20:28+00:00 2026-06-04T04:20:28+00:00

I have a p:fileUpload function on my page and every time I upload a

  • 0

I have a p:fileUpload function on my page and every time I upload a file I cannot seem to find it in the folder specified in my web.xml file.

I have added the following jars to my library: primefaces-3.2.jar commons-io-2.3.jar commons-fileupload-1.2.2.jar

Here is my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
     version="3.0">

    <filter> 
        <filter-name>PrimeFaces FileUpload Filter</filter-name> 
        <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class> 
    <init-param> 
        <param-name>uploadDirectory</param-name> 
        <param-value>C:\Users\SomeUser\Documents\NetBeansProjects\System\Upload\</param-value> 
    </init-param> 
    <init-param> 
        <param-name>thresholdSize</param-name> 
        <param-value>1000000</param-value> 
    </init-param> 
    </filter>

    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>

    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>

    <error-page>
        <error-code>404</error-code>
        <location>/404.jsf</location>
    </error-page>

    <context-param>  
    <param-name>primefaces.THEME</param-name>  
    <param-value>aristo</param-value>  
</context-param>  

</web-app>

I am using the following:
PrimeFaces 3.2, JSF 2.0 and GlassFish 3.1.1

Any help will be appreciated. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:20:30+00:00Added an answer on June 4, 2026 at 4:20 am

    It stores it by default in the system default temp directory as identified by java.io.tmpdir system property. You could use UploadedFile#getContents() or UploadedFile#getInputStream() to get the file contents and write it to the desired folder. But you can also change the default upload location by an initialization parameter of the filter.

    Put this inside the <filter> element of the file upload filter:

    <init-param>
        <param-name>uploadDirectory</param-name>
        <param-value>/path/to/uploads</param-value>
    </init-param>
    

    Note that when you’re running Windows, it will be relative to the disk from where the webserver is started. So if it’s C:\, then the above init param will actually resolve to C:\path\to\uploads. You should also make sure that this folder is already been prepared beforehand and thus exists and is writable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a FileUpload control in the Source page. On the Upload button handler,
I have an aspx page with multiple FileUpload controls and one Upload button. In
I have a file upload control <input id=File1 type=file /> in my page... How
I have a Web Application in which I am using asp:FileUpload Control to upload
Here's the case: We have a file upload page. We didn't want to reload
I am attempting to have a file upload page that allows for an arbitrary
I have a web application with a simple upload function. The idea is to
I have upload file functionality on one of the page. I check for the
I have a page with a form that has a file upload input item
I have HTML page, which gives an option to upload a file to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.