Re: Can ajax upload file to a controller instead of uploadHanler.ashx?

  •  11-20-2012, 11:06 PM

    Re: Can ajax upload file to a controller instead of uploadHanler.ashx?

    Hi,

     

    Here is the client side API to set the data

     

    1. <script> 
    2.     var inp = document.getElementById("textboxid"); 
    3.     var currtask; 
    4.  
    5.     inp.onchange = function () { 
    6.         if(currtask) 
    7.             currtask.SetClientData(inp.value); 
    8.     } 
    9.     function CuteWebUI_AjaxUploader_OnTaskStart(task) { 
    10.         currtask = task; 
    11.         currtask.SetClientData(inp.value); 
    12.     } 
    13. </script> 
     

     and here is how server side use it

     

    1. if (uploader.IsValidationRequest) 
    2.     string clientdata = Request.Form["_AjaxUploaderClientData_"]; 
    3.     uploader.WriteValidationError("Test : client data : "+clientdata); 
    4.     Response.End(); 
     

     Regards,

    Terry

     

     

View Complete Thread