views:

381

answers:

2

I'm trying to get a web page to display a .gif/.jpg/.png selected by the user through a File Open dialog.

Trouble is, as far as I can see, the is specifically designed to upload the selected file to the web server, whereas I only want to get the file's location so I can feed it into the Image.FromFile Method of the System.Drawing namespace.

Is it possible to get Image.FromFile to load a file from the user's own file system?

A: 

No. you can't do this. Upload it to a server and take the file from that location.

rahul
+1  A: 

Image.FromFile runs on the server, from the server you do not have access to the client's PC.

You could display a file from the users PC on a web page by using an IMG tag with a src of a file path, like the following:

<img src="file://C:/FolderOnClientPC/image.jpg" />

Patrick McDonald