Reputation: 55
Not sure why I can't seem to update a value. I'm using a file uploader and I need to append an invoice number to the file name, so we don't get duplicate files.
Here is the code:
console.log(data.files[0]);
console.log(data.files[0].name);
console.log('$("#InvoiceNumber").val() =' + $("#InvoiceNumber").val() + "-" + data.files[0]['name']);
//here I try to update
data.files[0]['name'].value = $("#InvoiceNumber").val() + data.files[0]['name'];
//have also tried
// data.files[0]['name'] = $("#InvoiceNumber").val() + data.files[0]['name'];
//and
//data.files[0].name = $("#InvoiceNumber").val() + data.files[0].name;
console.log(data.files[0]);
The results from outputting to console are.
I can't change the file name server side, as duplicates exist. Anyone know why I can't update that value. Thanks
Upvotes: 1
Views: 49