.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to open local system folder from the browser

Posted By: Suraj Kumar     Posted Date: July 08, 2014    Points:5   Category :ASP.Net
Hi All,

I'm working on some stuff, wherein the user downloads the files from internet to his local machine. I'm able to catch the path of the folder where user wants to download the file from SaveAs prompt. Now my requirement is , i want to provide a link button or a button on the web page and assign this is folder path dynamically so that when the user clicks on it, it should open the local system folder where he has downloaded the files.

string myDocspath =Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string windir = Environment.GetEnvironmentVariable("WINDIR");
System.Diagnostics.Process prc = new System.Diagnostics.Process();
prc.StartInfo.FileName = windir + @"\explorer.exe";
prc.StartInfo.Arguments = myDocspath;

Work fine with local system, if i host the application in IIS , the above code snippet wont work

Thanks in advance,

Suraj Kumar

Author: Ashutosh Jha             
Posted Date: July 29, 2014     Points: 20   
Author: Deco             
Posted Date: August 08, 2014     Points: 20   

Please find the below URL, It will shed some light on


Author: Sambanthamoorthy             
Posted Date: September 02, 2014     Points: 20   

c# display images from local drives

This article helps you to display an image from your local drive

Display Images from Local Drives

Normally we will have the images inside the folder in our application root folder. The source selector dialog box will point to the application folder only, there is no direct option to select the images existing outside the application folder but there is a work around for this to display the images available in the physical drive. ofcourse it is really meaningless to set the source of the image in the physical drive. Rare cases will be there to display the already available image in the local drives for some scenario.
Let us see in detail on how to display the images from our local folder

Methods of Implementation

As a first step, we can have a new aspx page, In my example i have named the page as "SampleImage.aspx".
In the page load event of the SampleImage.aspx.cs we can have the below lines of code;

protected void Page_Load(object sender, EventArgs e)
Response.ContentType = "image/png"; // for .png extension
string PhysicalImageName = @"C:\filing.png";

Now we can get easily set the source of the image in the Target pages using the below line of declaration in the aspx page as;

<img src="SampleImage.aspx" alt="Admin" runat="server"/>
- See more at: http://dotnetbites.com/display-images-from-local-drives#sthash.h0KoepKc.dpuf

Author: Subhransu Sekhar Jena             
Posted Date: June 25, 2015     Points: 20   

You can do this using IE Only. But for this you have to enable the activex control of IE Other wise use node.js or HTMLS or Any advanced Java script framework.


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend