0

I'm generating a word or pdf file from a backend, passing the word file into a byteArray or base64 format to the backend. This file is stored into a outside of the angular folder. i.e., D:/drive.

I have to display the word of pdf file into the webpage. It's not working because it's the file is outside of project folder.

Is there any other way to access the files that is outside of the angular project?

  1. I have tried different formats of files coming from the backend.

  2. I have implement ngx-exnteded-pdf-viewer, ngx-doc-viewer, iframe everything but nothing gives a solution to my problem.

My only confusion is how to access the files outsid of the project folder.

Chris Barr
  • 29,851
  • 23
  • 95
  • 135

1 Answers1

0

Any web application will not have access to your local file system at all. This would be a huge security issue is any website you visit could access any file on your disk!

The only way to give a web application access to a file is to provide a link to it. That link must either be available via a URL you can point your application to, or included within your Angular project.

In angular you can put files like this in the src/assets/ folder. See this question for information on how to access files in that folder from within your application.

Chris Barr
  • 29,851
  • 23
  • 95
  • 135