Legacy Knowledge Base
Published Jul. 2, 2025

When a file is not uploaded, the upload field throws a validation error, even if it is not required

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The form is not submitted correctly
    Steps to reproduce:
    1) Create an object with the text field required
    2) Create an object with an upload field NOT REQUIRED
    3) Create a new content page
    4) Add a Form container
    4.a) Map it to the object created before
    5) Add a text field
    5.a) Map it to the text field
    6) Add an upload field
    6.a) Map it to upload the field
    7) Add submit button
    8) Save and publish
    9) Access the form
    10) Enter something in the text field
    Observed Behavior: A validation error is shown and the form is not submitted.
    Document: Please enter a file with a valid extension (pdf)
    Expected Behavior: The form is submitted correctly.

Environment

  • Liferay DXP 7.4

Resolution

  • The observed behavior is a known DXP bug which is addressed in DXP 7.4 update 35.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base