Upload Binary Content

You can upload binary content to any force.com endpoint that supports the binary upload feature.

The sendRequest() method in react.force.net.js has a new optional parameter named fileParams.

This parameter expects the following form:

For example:

The github.com/wmathurin/MyUserPicReactNative sample app demonstrates binary upload. This sample allows you to change your profile picture. Binary upload of the new pic happens in the uploadPhoto() function of the UserPic.js file.

Here’s the sample’s sendRequest() call in the getUserInfo() function: