Download fails immediately after successful upload
I have a case where I am getting a 404 error trying to download a file I can see that I have successfully uploaded. I'm using the file-id not the file name. In other context download code works, but it fails if I try to download right after upload. I tried adding 3 seconds of sleep, but it did not help.
Download code is pretty simple. I can see that I have a file-id, which means the file uploaded. But on download 404
public Stream DownloadFile(string uuid)
{
InitBox();
return client.FilesManager.DownloadStreamAsync(uuid).Result;
}
-
Good morning ,
it seems that the fact that a document won't be available just right after uploading it is something indicated on BOX api reference:
If the file is not ready to be downloaded (i.e. in the case where the file was uploaded immediately before the download request), a response with an HTTP status of 202 Accepted will be returned with a Retry-After header indicating the time in seconds after which the file will be available for the client to download.
The strange thing is that you receive a 404 and you should receive a 202.
The 3 seconds sleep you indicate probably are not enough as per what explains the time is indicated on a header variable.
I understand that the document is processed, stored in several nodes, and that will take several seconds before it is allowed to be retrieved.
Thanks
サインインしてコメントを残してください。
コメント
1件のコメント