MonkeyChewTobacco
MonkeyChewTobacco

Reputation:

System.Drawing Image.FromFile from user's file system

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?

Upvotes: 0

Views: 1126

Answers (2)

Patrick McDonald
Patrick McDonald

Reputation: 65441

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" />

Upvotes: 1

rahul
rahul

Reputation: 187090

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

Upvotes: 0

Related Questions