I hope to update the files’ info after the queued files uploaded, instead of refresh the whole file list.
The vault docs say the vault.update() method can not be used to change id, then how can ?
Many thanks.
I hope to update the files’ info after the queued files uploaded, instead of refresh the whole file list.
The vault docs say the vault.update() method can not be used to change id, then how can ?
Many thanks.
Hello @jyginger ,
Unfortunately, there is no built-in way to replace the temporary file id with a server-generated id.
As a workaround, you can store the server id in an additional field.
For example, if your backend returns the following response after upload:
{
"id": 123,
"link": "/files/1.txt"
}
you can save the server id in the file item:
vault.events.on("uploadFile", (file, value) => {
vault.data.update(file.id, {
serverId: value.id
});
});
This will keep the original Vault id unchanged while allowing you to use serverId for subsequent operations.
Thanks Maksim, it works ![]()