// Configure Dropzone
Dropzone.options.myDropzone = {
init: function () {
this.on("addedfile", function (file) {
// Prepare the file for sending to REST API
const formData = new FormData();
formData.append("file", file);
// Send the file to REST API
fetch("rest_api_url", {
method: "POST",
body: formData,
})
.then(response => response.json())
.then(data => {
// Handle API response
console.log(data);
})
.catch(error => {
console.error("Error sending file:", error);
});
});
},