I'm able to access the properties inside the File object (Eg. name, size, etc) but I'm not able to mutate it. I wanted to know, how would I do that.
If that is not possible, then how can I convert the File object to a Javascript object
Purpose: Wanted to truncate the name of the file if it exceeds a certain limit.
Eg:
Input :
File {
lastModified: 1633413497251
name: "Screenshot_2022-09-18-13-25-22-10_6012fa4d4ddec268fc5c7112cbb265e7_Screenshot_2022-09-18-13-25-22-10_6012fa4d4ddec268fc5c7112cbb265e7.jpeg"
size: 384664
type: "image/jpeg"
webkitRelativePath: ""
}
Output :
File {
lastModified: 1633413497251
name: "Screenshot_2022-09-18-13-_TRUNCATED_fa4d4ddec268fc5c7112cbb265e7.jpeg"
size: 384664
type: "image/jpeg"
webkitRelativePath: ""
}