Apart from the code, you need to understand how the file sharing is set up between the servers, if at all. That could be a samba or NFS share on the unix side, exposed as a network path (UNC path or mapped drive) on Windows. Or it could be a CIFS mount on the unix side, exposing a Windows share as a mount point on unix.
A third possibility is that there is no direct sharing between machines. In that case you could use a network share, e.g. a location on a NAS, that is accessible from both servers. You could have the code push the file from one side, and have some process on the other side pull down the file, e.g. by cron job or scheduled task. But we don't know your requirements so that may not be feasible.
Check with your system administrator on how file sharing is set up for you.
Apart from file shares, there are options for file copying like sftp and rsync that can be automated.