Getting 404 while trying to preview a newly edited office document in ngx doc viewer Angular

246 views Asked by At

I'm working on ngx-doc-viewer in angular and when I'm trying to get a document preview of Docx file I'm getting 404 in one case.

I'm uploading my document to a blob storage and giving that blob URL for the file URL of the document. Normally, If I upload a docx file to blob storage and using that blob URL to get the preview I'm getting the document preview properly When uploaded document normally

But when I edit a document using wps office(not sure if it will happen with other editors also) and immediately upload that document. I'm getting 404 while it is fetching the preview. If I do the preview again after sometime It is loading fine. When uploading immediately edited document.

Any suggestions?

Initially I thought it was due to location Im getting it even before file is completely uploaded but It was working incase I upload a document that was not edited recently so I ruled out that case.

1

There are 1 answers

0
Venkatesan On

Getting 404 while it is fetching the preview

The above error occurs

  • If another client deleted a container or blob before this request.
  • If the specified blob or resource URL does not exist may cause 404 error.
  • Please make sure the filename (blob name) you provided indeed exists in your container because blob name is case sensitive.
  • If you are accessing through private container is one possible reason and change Access level to container or blob.

I tried in my environment to fetch file from azure blob storage and got same error in postman:

Postman:

enter image description here

I tried with proper Url+SAS-token, I can successfully fetch files from postman.

enter image description here

Reference: Azure Storage Static website error - Resource not found or content doesn't exist - Stack Overflow by Bennie van der Walt.