Hi folks,
i have one directory with different kind of files like html files,csv files,text files and subfolders.
but here requirement is,how to retrieve only text files and add it to array in javascript with the support of html.
Thanks in advance
Regards
Ravi Gaddam

Kunal VaishyaRank #990 · 2K reputationPosted Nov 28, 2013, 3:04 AM EST
String DirPath = Application.StartupPath + "\\New folder";
Or
String DirPath = Server.MapPath("/New folder");
Logic -
System.IO.FileInfo[] FileInfo ;
System.IO.DirectoryInfo DirInfo = new System.IO.DirectoryInfo(DirPath);
// You will Get the Array in "FileInfo" Object
FileInfo = DirInfo.GetFiles();
String str = "";
for (int i = 0; i < FileInfo.Length - 1; i++)
{
str =FileInfo[i].Name;
}
Ravi Gaddam60 reputationPosted Nov 28, 2013, 3:53 AM EST
Thanks for reply
i need code in javascript itself, because,my system doesn`t have any softwares like java and .net
Thanks
Ravi gaddam