Writing files
Now that we know how to read files, we will learn how to use the VFS transport for writing content to files, no matter what the source of the data is: another file, API, Proxy service, inbound endpoint, task, or any other.
For writing the file, we need to create an endpoint with the path where the file will be created:
- Local
- FTP
- Samba
This endpoint will be used inside a send or call mediator, as follows:
<call> <endpoint> <address uri="vfs:file:///home/user/vfs/out"/> </endpoint> </call>
When we want to create a file, we need to use the OUT_ONLY
property, because this is a single-way operation and the server does not need to wait for a response. Another property that we use in the write file process is ReplyFileName
, which will specify the name and extension of the file that will be created. We can use the MessageID
property to get a unique filename for every file that is created (for example, we can use it to store all the incoming requests...