DropzoneJS file upload breaks with AJAX callbacks in the form

Created on 18 March 2020, almost 5 years ago
Updated 6 March 2024, 10 months ago

When you've added one or multiple files with dropzone JS and in the same form you have one or multiple ajax callbacks (for example a field with "add one more item" file upload breaks and no file is submitted.

This is because during an upload the file is renamed with a .txt extension. During form validation the file is renamed to the same filename but without .txt. If an AJAX callback happens in the form it will do this validation action and if the form is submitted it tries to do the validation action again. This time the file is not found because it doesn't exist anymore with .txt.

I've added a patch that fixes it for our situation, but be careful because this removes the secure file name.

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands barthje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024