everything correct except:
- you must pass the full path of tmp.txt to forfopen or copying forfopen.exe in the folder where it will be created
- locally you will have a file called tmp.txt, not server.cfg: tmp.txt is the local name of the saved file while server.cfg is the remote one
so your problem is for sure the first point because the location of where the file will be saved can change between the various operating systems:
q3dirtrav-cod4-on-windows-7-t1348.html