Hello, this is breaking my head. I have two uploader elements. For some reason, the uploader when uploads something it returns the value like was uploaded by the other one.
Example:
Uploader A
Uploader B
If I upload something to uploader A, gets published by the uploader B or sometimes and sometimes B uploads to A (if you refresh the page it’s random).
Code:
const inputElement = document.getElementById(''+uniqueid+'');
const pond = FilePond.create( inputElement, fileOPs);
FilePond.setOptions({
server: {
revert: null,
process: (fieldName, file, metadata, load, error, progress, abort) => {
if (server == "AWS") {
function uploadCback(err, url) {
if (url) {
load(url);
publishState("filename", file.name);
publishState("fileurl", url);
publishState("base64", metadata.base64);
triggerEvent("file_is_uploaded");
}
else {
console.error(err.toString());
error(err.toString());
}
};
uploadContent(file.name, metadata.base64, uploadCback);
}
.................................
Do you guys see something wrong there?
The only thing I changed recently was the way was selecting the element.
I changed:
const inputElement = document.querySelector('input[type="file"]');
to
const inputElement = document.getElementById(''+uniqueid+'');