Reputation: 11
I am trying to renname a file using fine uploader and the change keeps getting ignored
$(this).fineUploader({setName: {id: new_name}});
new_name of course was set earlier.
This seems to be correct and doesn't throw an error but just doesn't work. Any ideas
Upvotes: 1
Views: 150
Reputation: 18125
The setName
function can be called from jQuery using the below syntax. Note that we are plugging into the onSubmit
event in order to obtain an id
of a file which setName
requires.
var $uploader =
$(this).fineUploader({
})
.on("submit", function (event, fileId, fileName) {
$uploader.fineUploader("setName", fileId, new_name);
});
Upvotes: 1