How to write to a file with another userId?


in our application (flow / java services), we have to create files in the specified directory. The technical user the Integration Server is running with, does not have permission to create files in this directory; we have to perform the file system access under another userId that does have the permission.

Is it possible to somehow change the userId for the duration of one service call (file creation in our case)? I want that the file system “thinks” that some other user is accessing it.

One option for accessing the file system under another userId would be to use FTP (which is possible in our case, i.e. the directory can also be accessed via FTP). But this is much more complicated than just using file access services.

Thank you for any hints.

UPDATE: Would it be possible using the remote invoke that leads to the same IS? I just do not quite understand what user is used when it comes to the file system access.


easiest would be to grant your technical user access to the directory.

Remote invoke is possibly not an option here as it is still running in the same IS with the rights of the technical user the IS is runing on.

One option might be using executeOSCommand, see Built-In-Services reference for further informations.


Unfortunately, we’re not allowed to grant any permissions to that user since it’s only used for running the platform and not for any other purpose. I think I’ll stick to the FTP solution for now.


you should consider switching to the SFTP option then, which is available since wM 9.5.

Additional question:
Writing the files is not covered by “running the platform”?
I think there is a gap somewhere in the concept of this platform.


Sure, I meant not literally FTP, but one of its secure incarnations (FTPS or SFTP). I know that SFTP is a different protocol than FTP.