2

Does anyone know how to list all files in an specific directory?

I can't seem to find an answer with the same content. In .Net it was like Directory.GetFiles(dir), I don't know what is the counterpart of that in Typescript.

2 Answers 2

2

I won't be able to use the server side to do that function since it is not capable in doing that. We are using composer rest server as api. So I really need to get the file using angular.

Sign up to request clarification or add additional context in comments.

Comments

1

Client-side javascript (browser) does not have access to file system. On server the way depends on what technology you use.

From your description is not obvious where you need to access file system. Please update your question with additional information.


Edit:

You cannot list directory with Angular. The only option is to use HTTP request to get content of file. The file must contain generated JSON (for example) with all filepaths. So you need server which will generate the file for you. Angular is designed to work with provided data from APIs, not for using file system.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.