Add Additional Parameter to FileItem on Init #842
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm having a bit of an issue with adding additional parameters. My use case is that I need to be able to add multiple documents on file drop, and then using checkboxes set some of them as contracts. I know I can use
uploader = new FileUploader({ url: URL, method: 'post', additionalParameter: { isContract: false } });to add a new parameter, but this is at the uploader level, and checking one checkbox will set all FileItems as true.I also know that there is
this.uploader.onBuildItemForm = (fileItem, form) => { form.append('isContract', 'true'); return { fileItem, form } };too, but I can't think of a clean way to alter this on click of a checkbox without making an array of bools of the same size as my uploader.queue... which seems a bit hacky.Is ther any clean way of achieving what I need to do?