Submitting a Document with the same name results in an error and losing the file from the form field
How To articles are not official guidelines or officially
supporteddocumentation. They are community-contributed content and may
not alwaysreflect the latest updates to Liferay DXP. We welcome your
feedback toimprove How to articles!
While we make every effort to ensure this Knowledge Base is accurate,
itmay not always reflect the most recent updates or official
guidelines.We appreciate your understanding and encourage you to reach
out with anyfeedback or concerns.
Legacy Article
You are viewing an article from our legacy
"FastTrack"publication program, made available for
informational purposes. Articlesin this program were published without a
requirement for independentediting or verification and are provided
"as is" withoutguarantee.
Before using any information from this article, independently verify
itssuitability for your situation and project.
Issue
- When you submit a file in the Documents and Media portlet that has the same title as a different file, an error is produced that prevents you from submitting it. When this happens, the file is lost from the form field because the page is reloaded. For security reasons, we are unable to programmatically repopulate the input of type file when the submission fails. This is a technical limitation, present in browsers for security reasons.
Environment
- Liferay DXP 7.0
- Liferay DXP 7.1
- Liferay DXP 7.2
Resolution
-
One of the drop down error messages prompts the user to re-select the file that they would like to upload, in addition to changing the name of the title. Once this is done, the file can be published, and the preview will be generated.
- If the user submits again without re-selecting the file, Liferay will generate a 0 KB file that has the name of document, as a placeholder.
Did this article resolve your issue ?