Your current path is evaluated as \server\tmp\...which by default will be c:\server\tmp\....
To create a UNC path, you will need an additional escaped-separator:
System.IO.File.WriteAllBytes("\\\\server\\tmp\\" + FileName, fileData);
or you can use a string literal instead:
System.IO.File.WriteAllBytes(@"\\server\tmp\" + FileName, fileData);
source
share