6

I have this folder/directory 'x' in the public folder of my application. Now I have path name till the folder i.e., /path/to/dir/x , but I don't know the names of the files in this directory. Now I need to provide URL links to the files in the html a tag's href attribute.

How do I list the name of the files in this directory?

4
  • 5
    AngularJS is client side(runs in browser) you have to do this in server side and get the information using $http Commented Apr 6, 2015 at 11:54
  • 1
    Try this solution [Link][1] or [enter link description here][2] [1]: stackoverflow.com/questions/20822273/… [2]: stackoverflow.com/questions/15448574/… Commented Apr 6, 2015 at 11:57
  • 1
    Use Directory.GetFiles(path) method to list all the files and then in angular use ng-repeat and build a URL on the client. Commented Apr 6, 2015 at 14:36
  • Alternatively, you can use AJAX calls: stackoverflow.com/a/11213851/2220216 Commented Sep 7, 2015 at 16:59

1 Answer 1

1

Angular is a client side library. Getting files from file directories is a backend capability.

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

3 Comments

Welcome to StackOverflow! Thanks for this answer, but that's already been said in the first comment, so this doesn't add anything.
Wrong! We have now 2017. We are using angular in electron that is running locally on desktop. So using the file system is a valid question.
@SandorRozsa So is it possible?

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.