Re: Ajaxuploader stops uploading files

  •  08-24-2009, 6:31 PM

    Re: Ajaxuploader stops uploading files

    How do I prevent the network/server from resetting?  The sample site is running under the visual studio webserver.
     
    After further testing the error happens in IE and FF.  I've been debugging the Sample #2 MVC C# Demo site using visual studio and IE8.  Everytime the ProcessRequest function finishes in the UploadHandler.ashx, I get an alert box on IE error code I posted earlier.
     
    Here's the code:
     
    1.   public void ProcessRequest (HttpContext context) {  
    2. using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(context))  
    3. {  
    4.     uploader.UploadUrl = context.Response.ApplyAppPathModifier("~/UploadHandler.ashx");  
    5.     //the data of the uploader will render as <input type='hidden' name='myuploader'>   
    6.     uploader.FormName = "myuploader";  
    7.     uploader.AllowedFileExtensions = "*.jpg,*.gif,*.png,*.bmp,*.zip,*.rar";  
    8.       
    9.     //let uploader process the common task and return common result  
    10.     uploader.PreProcessRequest();  
    11.   
    12.     //if need validate the file : (after the PreProcessRequest have validated the size/extensions)  
    13.     if (uploader.IsValidationRequest)  
    14.     {  
    15.         //get the file need be validated:  
    16.         MvcUploadFile file = uploader.GetValidatingFile();  
    17.           
    18.         if (string.Equals(Path.GetExtension(file.FileName), ".bmp", StringComparison.OrdinalIgnoreCase))  
    19.         {  
    20.             uploader.WriteValidationError("My custom validation error : do not upload bmp");  
    21.             return;  
    22.         }  
    23.   
    24.         uploader.WriteValidationOK();  
    25.         return;  
    26.     }  
    27. }  
    28.   } 
View Complete Thread