2 Replies Latest reply on Jun 8, 2010 9:12 AM by msakrejda

    Upload a file biggest than server max upload size

    ric_bia Level 1

      I'm uploading files to a server using Flex and the FileReference class.

       

      var request:URLRequest = new URLRequest();
      request.url = myUploadURL;
      request.method = URLRequestMethod.POST;
                          
      _refUploadFile = new FileReference();
      _refUploadFile = myUploadFile;
      _refUploadFile.addEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
      _refUploadFile.addEventListener(HTTPStatusEvent.HTTP_STATUS, onUploadFailed);
      _refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
      _refUploadFile.addEventListener(ProgressEvent.PROGRESS, onUploadProgress);
      _refUploadFile.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, onUploadDataHandler);
      try
      {
          _refUploadFile.upload(request, "file", false);
      }
      catch (error:Error)
      {
          Alert.show('Error');
      }

       

      On "normal" size files this works good and onUploadDataHandler() is called by DataEvent.UPLOAD_COMPLETE_DATA

       

      On "too big" size files no error is thrown (try/catch doesn't returns the error message) and no functions are called by the listeners.


      The ProgressEvent.PROGRESS also continues to dispatch itself with a bytesLoaded value increasing till bytesTotal.

       

      At the 100% of the ProgressEvent the file is not added to the server and the event

      DataEvent.UPLOAD_COMPLETE_DATA is not dispatched (the function onUploadDataHandler() is not called)

       

      Anyone could give me a tip?