Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit d430dff

Browse files
authored
fix empty upload_path (#210)
1 parent caf85e4 commit d430dff

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/resources/assets/js/modules/upload.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,18 @@ export default {
172172
sending: function (file, xhr, formData) {
173173
uploadProgress += parseFloat(100 / allFiles)
174174
manager.progressCounter = `${Math.round(uploadProgress)}%`
175+
176+
//fix if Dropzone doesnt find the form. This only happens if you use direct drag and drop on the div (__stack-container).
177+
if (!formData.has('upload_path')) {
178+
try {
179+
let path = document.querySelector("#new-upload input[name='upload_path']").value;
180+
if (path !== '') {
181+
formData.append('upload_path', path);
182+
}
183+
} catch (error) {
184+
console.debug(error);
185+
}
186+
}
175187

176188
// send files custom options
177189
formData.append('custom_attrs', JSON.stringify(manager.uploadPreviewOptionsList))

0 commit comments

Comments
 (0)