0

Is it possible to open a local drive on Website link click? Example, if i have a link called ArtWork. When user clicks this link, in the code behind i should do something to open D:/ArtWork . This is using C# in Asp.Net in VS 2005.

Is it possible?

challengeAccepted
  • 7,106
  • 20
  • 74
  • 105

2 Answers2

1

The question is what you mean by "open D:\ArtWork".

If you want to do things (other than just upload) with the files:

In browsers that support it, you can use the File API.

HTML5 provides very powerful APIs to interact with binary data and a user's local file system. The File APIs give web applications the ability to do things like read files [a]synchronously, create arbitrary Blobs, write files to a temporary location, recursively read a file directory, perform file drag and drop from the desktop to the browser, and upload binary data using XMLHttpRequest2.

If you wish to allow the user to just select a file from a folder and upload it:

Ever since Microsoft ASP.NET was introduced with version 1.0, there has been the built-in means of building Web applications that had the ability to upload files to the hosting server. This was done through the use of the File Field HTML server control.

http://msdn.microsoft.com/en-us/library/aa479405.aspx

Eric J.
  • 147,927
  • 63
  • 340
  • 553
1

In general, this will not work because most browsers refuse to open anchors (<a>) that have href="file://..." which is the only way that you could open the local hard drive of the user and point it to the D:\ArtWork directory.

Here's a similar question.

Community
  • 1
  • 1
Icarus
  • 63,293
  • 14
  • 100
  • 115