www.dextsolution.com
DEXTUPLOAD
X5
Reference > Events

## onDX5UploadBegin

- Version 1.0.0.0 or later

- Explanation

  The onDX5UploadBegin function is a callback function that is called when the upload starts.

      function onDX5UploadBegin(id) {
          ...
      }

- Uses

      # Declare event handlers globally
      function onDX5UploadBegin(id) { ... }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              uploadBegin: function(id) { ... }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event

## onDX5UploadCompleted

- Version 1.0.0.0 or later

- Explanation

  The onDX5UploadCompleted function is a callback function that is called when the upload is completed.

  To check the response data sent by the server, you need to check this function after it is called.

      function onDX5UploadCompleted(id) {
          var result = "";
          // if ORAF method
          result = dx5.get(id).getResponses(0);
          // If OROF or EXTS method
          result = dx5.get(id).getResponses().join("\n");
          alert("Upload completed.\nServer response is:\n" + result);
      }

- Uses

      # Declare event handlers globally
      function onDX5UploadCompleted(id) { ... }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              uploadCompleted: function(id) { ... }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event
  result (Version 4.0.0.0 or later) | Array<{ id: String, response: String }> | You can get the response data directly from the parameters of the event callback function without using the getResponses method. id: ID of the uploaded item response: response data of the uploaded item For ORAF, the length of the result is 1, and the value of the id attribute of the element is an empty string.

## onDX5UploadItemEnd

- Version 1.0.0.0 or later

- Explanation

  The onDX5UploadItemEnd function is a callback function that is called when uploading is completed for each individual file.

  When uploaded using the ORAF method, this event does not occur.

      function onDX5UploadItemEnd(id, itemId) {
          ...
      }

- Uses

      # Declare event handlers globally
      function onDX5UploadItemEnd(id, itemId) { ... }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              uploadItemEnd: function(id, itemId) { ... }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event
  itemId | String | Unique ID of the item

## onDX5UploadItemStart

- Version 1.0.0.0 or later

- Explanation

  The onDX5UploadItemStart function is a callback function that is called when the upload starts for each individual file.

  When uploaded using the ORAF method, this event does not occur.

      function onDX5UploadItemStart(id) {
          ...
      }

- Uses

      # Declare event handlers globally
      function onDX5UploadItemStart(id, itemId) { ... }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              uploadItemStart: function(id, itemId) { ... }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event
  itemId | String | Unique ID of the item

## onDX5UploadStopped

- Version 1.0.0.0 or later

- Explanation

  The onDX5UploadStopped function is a callback function that is called after an upload has been forced to stop.

      function onDX5UploadStopped(id) {
          alert("Upload aborted.");
      }

- Uses

      # Declare event handlers globally
      function onDX5UploadStopped(id) { ... }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              uploadStopped: function(id) { ... }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event