I am having a touble with selecting and viewing pdf and word files from hard disk in asp.net .
can someone tell me how.
Please put codings.....
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dipa AhujaPosted Apr 15, 2010, 11:32 AM
Dipa AhujaPosted Apr 16, 2010, 11:46 AM
sam jdamPosted Apr 16, 2010, 9:43 AM
Dipa AhujaPosted Apr 16, 2010, 7:51 AM
sam jdamPosted Apr 15, 2010, 8:55 PM
sam jdamPosted Apr 15, 2010, 9:24 AM
_______________________________________________________________
void Page_Load(object s, EventArgs e)
{
DirectoryInfo di = new DirectoryInfo("E:\\Backup\\Documents");
FileInfo[] rgFiles = di.GetFiles("*.pdf");
foreach (FileInfo fi in rgFiles)
{
Response.Write("
" + fi.Name + "");
}
}
_______________________________________________________________
I can see all the files in the directory, but i can't click and open any of them.
I can click and read the pdf file, only if that file is in the project folder. If the file is not in the project folder an error is shown.
So how to generate a href link with reference to a specific folder on hard disk............eg: path -"E:\\Backup\\Documents".
Dipa AhujaPosted Apr 14, 2010, 1:14 PM
Dipa AhujaPosted Apr 14, 2010, 12:23 PM
sam jdamPosted Apr 14, 2010, 9:16 AM
But please tell me, how to get a list of files on a hard disk folder to the web page, and then view them one by one using the
Dipa AhujaPosted Apr 14, 2010, 8:01 AM