FileUpload Issue

  1. #1

    FileUpload Issue


    Hi

    I have a problem when uploading a file which is too large.

    I have an Ext.FileUpload control placed on the form. After the selection is made a DirectMethod is automatically fired to upload the file. The method is never run and the Application_Error event is fired in the Global.asax where I have generic error handling taking place.

    void Application_Error(object sender, EventArgs e)
    {
                Exception exception = HttpContext.Current.Error;
                Server.ClearError();
    
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("********** {0} **********", DateTime.Now);
    
                var data = GetErrorData(exception);
    
                if (data.Length > 0)
                {
                    sb.AppendLine("Method Paramater List" + data);
                    sb.AppendLine();
                    sb.AppendLine();
                }
    
                sb.AppendLine(exception.ToString());
                
    
                ResourceManager.AjaxSuccess = false;
                ResourceManager.AjaxErrorMessage = sb.ToString();
    }
    The first thing is, is that the Application_Error is fired twice?? Secondly my generic javascript handler is never fired when catching errors? So an error is never returned.

    The js error function is one of this forum eg.

    <ext:ResourceManager runat="server">
        <Listeners>
              <AjaxRequestException Fn="handleError" />
         </Listeners>
    </ext:ResourceManager>
    
    function handleError(response, result, el, eventType, action, extraParams, o) {
    // display error in window
    }
    How do I catch this error?
  2. #2
    File cannot be transmitted using Ajax request (classic ajax request doesn't support binary data)
    Therefore hidden iframe is used to upload/download file. Therefore no ajax request, no ajax request error handler
    I suggest to use Failure handler for upload direct request (only if you do not return file, no download)

Similar Threads

  1. FileUpload Issue
    By glenh in forum 2.x Help
    Replies: 3
    Last Post: Nov 15, 2013, 7:05 AM
  2. [CLOSED] [2.2] FileUpload Validation issue
    By michaeld in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 13, 2013, 12:36 AM
  3. FileUpload issue
    By vbdotnetphp in forum 2.x Help
    Replies: 0
    Last Post: Oct 12, 2012, 12:56 PM
  4. FileUpload alignment issue in IE
    By Nagaraju in forum 1.x Help
    Replies: 1
    Last Post: Jan 19, 2012, 12:18 PM
  5. Fileupload after Save Dialog issue
    By reyonlines in forum 1.x Help
    Replies: 5
    Last Post: Jan 03, 2011, 5:27 PM

Posting Permissions