Add custom attributes to body #226
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?
Hello,
i want to add custom attributes (like description and size) to the body of each item before uploading.
Would be nice if you provide a function to do so.
Best regards and thanks for your support!
You can use onBuildItemForm to set the form body
this.uploader.onBuildItemForm = function(fileItem, form){ form.append('myvar', 'myval'); return {fileItem, form} }; this.uploader.queue[0].upload();Thank you very much!
Best greetings from Germany! :-)
I can probably figure it out, but the 2nd baby is only a couple weeks old and my brain is fried... Is it possible to append a var to a single fileItem rather than all?
UPDATE:
i did something like this:
in my view:
and back in my component
Thanks @cmyip for the initial code help
Thanks @cmyip for answer it' help for me so much