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?
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?
Share Improve this question asked Apr 6, 2015 at 11:44 Harsha VardhanHarsha Vardhan 1011 gold badge1 silver badge9 bronze badges 4-
5
AngularJS is client side(runs in browser) you have to do this in server side and get the information using
$http
– seenukarthi Commented Apr 6, 2015 at 11:54 - 1 Try this solution [Link][1] or [enter link description here][2] [1]: stackoverflow./questions/20822273/… [2]: stackoverflow./questions/15448574/… – Bhavesh Chauhan Commented Apr 6, 2015 at 11:57
-
1
Use
Directory.GetFiles(path)
method to list all the files and then in angular useng-repeat
and build a URL on the client. – Nilesh Commented Apr 6, 2015 at 14:36 - Alternatively, you can use AJAX calls: stackoverflow./a/11213851/2220216 – dshgna Commented Sep 7, 2015 at 16:59
1 Answer
Reset to default 1Angular is a client side library. Getting files from file directories is a backend capability.