How to upload an image when user selects a file in FileUpload control like in gmail?
I need to upload image or file when user selects that file like in gmail attach file without any other asp:button . What I mean is there shouldn't be any other button except file开发者_如何学运维upload control. And when a file is selected the file will be uploaded to the server folder.
How to implement that?
Please help.
Take a wee peek at this. Jquery + flash solution.
http://www.uploadify.com/demo/
That is done using JavaScript/AJAX. You can't do it only with ASP.NET controls.
Take a HTML control and use the "onchange" event of this control. Make a asp code file and write the file's upload code on that file. Now use Ajax and to send request to asp's code file.
When you will select file it will automatically upload by ajax. Because Html control events doesn't use server side.
精彩评论