Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ServerRemote
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 1: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
Your Filters
Interested
Ignored
     
0 Shai Vashdi 600
1 Tadit Dash 305
2 Sergey Alexandrovich Kryukov 250
3 Peter Leow 190
4 OriginalGriff 148
0 Sergey Alexandrovich Kryukov 9,395
1 OriginalGriff 5,473
2 Peter Leow 4,150
3 Maciej Los 3,540
4 Abhinav S 3,333


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid