mattgcon
mattgcon

Reputation: 4858

ASP.NET uploading image with just button click

Is there any controls that I can download that allows a user to upload images with just a button click and be able to open the file dialog. I do not want to use the fileupload control.

Upvotes: 0

Views: 3599

Answers (2)

Justin Soliz
Justin Soliz

Reputation: 2811

If you're looking for something with better asthetics, Steve Sanderson has a nice Ajax uploader with a progress bar you can check out. Pretty straightforward installation.

http://blog.stevensanderson.com/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/

Upvotes: 1

Kris van der Mast
Kris van der Mast

Reputation: 16613

According to me: no. It would open a security hole as if you don't let an enduser decide which file to select from his/her drive an application would be able to leech anything from that drive.

The ASP.NET fileupload control itself simply renders to an <input type="file"> html element. How the browser renders that is up to the browser. However it can be styled. For example like this: http://www.quirksmode.org/dom/inputfile.html.

If it's on a corporate LAN and there's a certain file on a users drive and (s)he opens your page then you might want to use something like a custom written ActiveX control which can be embedded in the rendered html to perform the task.
A variant on this one would be to create a winforms user control, embed that into the rendered html (a so called smart client), with enough CAS settings on the client pc to be able to do this.

Upvotes: 1

Related Questions