Click here to Skip to main content
15,908,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a few FileUpload controls , i am currently saving the files in database on Button click. The scenario is that i want to start transferring file the moment user selects a file.. but save them on database only when user clicks on the save button. I have googled a lot but could not find anything on such scenario.. I did find tutorials on how to save files without button click but that is not what i want because i want to save it only on Button Click BUT i want to start the transfer as soon as file is selected (just like Gmail).


XML
Currently i am using a custom file control made with the help of javascript..
<span class="FileUpload">
    <input type="file" size="24" id="BrowserHidden" runat="server" onchange="getElementById('FileField').value = getElementById('BrowserHidden').value;" />
    <span class="BrowserVisible"><input type="text" id="FileField" runat="server" /></span>
    </span>
Posted
Updated 5-Sep-13 23:44pm
v2
Comments
Khandwawala Hatim 6-Sep-13 5:40am    
which type of file upload control you are using (i.e. ASP file upload control or ajax or jquery)
arbaaz jalil 6-Sep-13 5:44am    
Updated my question

1 solution

Check this. And reply if it wont solve your problem.
 
Share this answer
 
Comments
arbaaz jalil 6-Sep-13 6:08am    
I am not sure if that links answers my question.. my question is that how can i start transferring the bytes to the server the moment i select file.. but save it on database only on button click.. I am trying to utilize the time during which user will be selecting more files.
Khandwawala Hatim 6-Sep-13 6:26am    
if this is the case you can use threading concept and with the above link help you can achieve the functionality. not sure with the implementation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900