challengeAccepted
challengeAccepted

Reputation: 7590

Open a Local drive on Website link click

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?

Upvotes: 0

Views: 1001

Answers (2)

Icarus
Icarus

Reputation: 63956

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.

Upvotes: 1

Eric J.
Eric J.

Reputation: 150108

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

Upvotes: 1

Related Questions