When I use
System.IO.File.WriteAllBytes("\\server\\tmp\\" + FileName, fileData);
It always seems to add "C:" to the beginning so it tries to save to c:\server\temp...
Is there a way around this?
Your current path evaluates to \server\tmp\... which will default to c:\server\tmp\....
To make a UNC path, you'll need an extra escaped directory-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);
@):WriteAllBytes(@"\\server\tmp\" + FileName, fileData);