How to send a file from one app to another

I want to send a file(pdf, jpg,png,,jpeg) which is uploaded in one application (say A) to be sent to another application(say B). i.e., The file in A should go to B.    
4 answers

The easiest way to do this would be to:

  1. Encode the filedocument in Base64 in the sending application
  2. Add those contents to your REST message (as a string)
  3. Send the message
  4. In the receiving application, decode from Base64
  5. Create the filedocument. 


Another way for doing this would be to use a REST call using Form Data,

  1. You can keep the headers empty.
  2. In request tab add the File and FileName as key and value pair.
  3. You can send metadata like this as Key and Value.


In this way there is no conversion to binary required, Hope this helps.



You can publish a service that gives a System.FileDocument type of response.
In your service;
- Retrieve file document that you want to send
- If found, return that object
- Otherwise, adjust your httpResponse and send empty object


You are asking for a solution to share files. To be honest, sharing files via API is not a common way.

Better and more easy is to use a shared file storage system (e.g. Amazon S3) use this for both applications. You can use the FTP (file transfer protocol) to upload/download files. All files changes are directly available for both apps.