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/
aman gandhiPosted Nov 23, 2011, 2:39 AM
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.
Prabhu RajaPosted Nov 19, 2011, 7:14 AM
Try this Code in Button Click Event() Handler.
Satish BhatPosted Nov 19, 2011, 4:08 AM
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
aman gandhiPosted Nov 19, 2011, 2:33 AM
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.
Satyapriya NayakPosted Nov 19, 2011, 2:21 AM
Please refer the below link
http://www.codeproject.com/KB/aspnet/fileupload.aspx
Thanks