Click here to Skip to main content
13,504,740 members
Rate this:
Please Sign up or sign in to vote.
See more:
i have a server link like:
in dat i hve create a folder name pdf where 100s pdfs are store with name like

through front end i m taking the value depending on some conditions as only "xyz".
now i want to retreive all the files from server name xyz like the ouput will be xyz_Q1,xyz_Q2 ans so on and clicking on the file i want to open the file from server on different tab.

i m not able to map with server through code. this i hve done with the folder keeping on my computer with the help of following code:

DirectoryInfo dinfo = new DirectoryInfo("..\\Portals\\PDFs");
FileInfo[] finfo = dinfo.GetFiles(string.Format("{0}*.pdf", var));
            for (int i = 0; i < finfo.Length; i++)

                list.Value = finfo[i].ToString();

please suggest some way to do the above thing with the remote url as when i pass the url in the directory info i m getting the exception as we cant pass url. i also tried to do with server.mappath like:

DirectoryInfo dinfo = new DirectoryInfo(Server.MapPath("");

Please suggest how to solve
Posted 10-Aug-12 1:12am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

In a client-server environment, it is always important to know where to run which program and how to communicate the results. Since your files are on a server with which you communicate via http, the code for filtering ought to be run on the server, too. That means, the code must be placed e.g. in an aspx page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180417.1 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100