Closed laurent-d closed 6 years ago
Hi @laurent-d , I totally forgot to document it :-)
Something like this should work:
FilePond.setOptions({
fileRenameFunction: (file) => {
// file contains a basename, extension and name (which is basename plus extension)
// return the new name, here we prepend some text and append some text
return `prepended_${ file.basename }_appended${ file.extension }`;
}
});
I've updated the docs with a quick example: https://pqina.nl/filepond/docs/patterns/plugins/file-rename/#usage
Thanks a lot ! Do you think you can concider the developpement for using filename attributes to set desired name with multiple instance of filepond and different forced filename ? I have tried to take the exemple of validate type plugin but some part of it are very blurry to me..
If you have multiple instantances you can pass each instance a unique function. The example above sets a generic function for all instances to use.
Thanks !
Hi @rikschennink ! This plugin looks promising, but how can we use it if we use multiple inputs : how retrieve the good filepond instance ? Can we set attribute on the input like the accept plugin ? Thanks for you work