Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Server Remote
i have a server link like: http://document.aaaa.com
in dat i hve create a folder name pdf where 100s pdfs are store with name like
xyz_Q1,xyz_Q2...
 
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));
            lstpdfs.Items.Clear();
            for (int i = 0; i < finfo.Length; i++)
            {
 
                list.Value = finfo[i].ToString();
                lstpdfs.Items.Add(list.Value);
            }
 
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("http://document.aaaa.com/foldername");
 
Please suggest how to solve
Posted 10-Aug-12 2:12am

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 381
1 Sergey Alexandrovich Kryukov 265
2 Praneet Nadkar 237
3 Marcin Kozub 225
4 /\jmot 189
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,614
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2014
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