I'm writing a wcf service for uploading files to a server. It works fine when I try to upload the file to the servers local c:/ drive,
but if I use a UNC path only 4096 kb is stored. It actually looks like part of the file is lost while storing it with writeStream.Write(buffer, 0, bytesRead);,
because I wrote the bytesread to an sql table and the number of elements are always the same no matter how many times I upload the file,
but the stored file is always different sizes, ranging from 1996 kb to 4092 kb.
I'm using IIS 7.5 on a windows 7 enterprise machine. My IIS is using a administrator account for the application pool, so it should not be a problem with permissions.
My wcf method uses Stream to upload the file in chunks
public void UploadFile(RemoteFileInfo request)
//some methods to set the filepath
int chunkSize = 4096;
byte buffer = new byte[chunkSize];
Stream writeStream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write);
View Complete Post