Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Controlling binary data upload with API methods

Updated on June 15, 2020

When you develop a Pega Platform™ mobile app, you can make it possible for mobile app users to pause and resume binary data upload. As a result, mobile app users can process their work items without having to wait for synchronization to finish or they can postpone large file uploads until they are in an area with better connectivity. The JavaScript API of the Pega Mobile Client™ provides the following methods that you can use to monitor and control binary data upload:

  • window.pms.plugins.clientstore.getFileForwardingState – Retrieves a state of the file forwarding process. This method returns a promise object. When the promise object is in the resolve state, it returns a Boolean value that corresponds to the state of the forwarding process.
  • window.pms.plugins.clientstore.setFileForwardingState – Sets the state of the file forwarding process. This method has a Boolean parameter state, which denotes the state of the file forwarding process. By default it is enabled. This method also returns a promise object. When the promise object is in the resolve state, it confirms that the operation has been successfully completed.

When configuring your application to enable users to pause and resume binary data upload, consider the following information:

  • If the state parameter is set to false, and the user adds a file, Pega Mobile Client notifies the server of the action, but it does not send the file. Therefore, you cannot validate the advance case action based on file upload, because Pega Platform rejects the advance case action until the server receives the file.
  • If the state parameter is initially set to true and the user toggles its value while the file is being uploaded, the upload process pauses immediately. Data synchronization continues, but no files are uploaded. Files that have not been uploaded are persisted and are uploaded after the flag is set to true again. For files that have been partially uploaded, the upload process resumes from where it paused.
  • If the state parameter is initially set to false and the user toggles its value while the synchronization is in process, files are not uploaded until the next synchronization session. You can call the ClientStore.start method to force binary data upload.
  • The value of the state parameter is persisted.

For more information, see Client Store and Searching device contacts with Pega Mobile Client API.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us