Upload a image without using file upload control
i want to upload a image but don't want to use file upload control. i want to use a single button.
when somebody click on it a open file dialogue should open. after select file when user click on ok button, image will be displayed in image control
thanks.
Aman Gandhi
http://auxiliumhelp.blogspot.com/

Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 18, 2011, 9:21 PM EST
Please refer the below link
http://www.codeproject.com/KB/aspnet/fileupload.aspx
Thanks
aman gandhi20 reputationPosted Nov 18, 2011, 9:33 PM EST
i want to open a open file dialogue box. and select image from it. on click of ok button i will get my image in my image control.
Satish BhatRank #2,496 · 563 reputationPosted Nov 18, 2011, 11:08 PM EST
is the only supported way for a browser to upload the file. Otherwise you have to write custom ActiveX controls ask the client browsers to install them. There are some third party controls which satisfy your requirement.
But you want to upload like Gmail, where there is no Upload button, no file upload control, you can hide those using css. Below is the link which explains the same.
Gmail style file upload in ASP.NET
Links for some of the third party controls.
SoftArtisans XFile
csXThumbUpload - ActiveX File and Image Uploader
Prabhu RajaRank #861 · 2.6K reputationPosted Nov 19, 2011, 2:14 AM EST
Try this Code in Button Click Event() Handler.
aman gandhi20 reputationPosted Nov 22, 2011, 9:39 PM EST
i am asking for web application.and if i try to use this this will showing an error.
"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."
how to resolve this.