We are considering using Vault to add file upload and download functionality to our web application. My question is: if multiple files are POSTed in a single request, is it possible to update the download links for each uploaded file in the response?
I tried the following sample, but it seems that downloads are not possible after uploading, which is why I’m asking this question.
Hello,
Yes, it is possible.
With singleRequest: true and updateFromResponse: true, Vault expects the server response to be a single JSON object where:
- keys are the temporary file IDs sent from the client
- values are objects with updated data for each file
Example:
{
"1713955200000": {
"link": "https://server.com/download/file_a.jpg",
"status": "uploaded"
},
"1713955200001": {
"link": "https://server.com/download/file_b.png",
"status": "uploaded"
}
}
Vault uses these IDs to update each file and apply the download links.
In the sample you’re referring to, the backend is not adapted for this format.
1 Like
@Maksim_Lakatkou
Thank you.
I’ll download the trial and try it out.
1 Like