public void upload(string fileName, Stream fileStream) { FileStream fileToupload = new FileStream("e:\\" + fileName, FileMode.Create); byte[] bytearray = new byte[10000]; int bytesRead, totalBytesRead = 0; do { bytesRead = fileStream.Read(bytearray, 0, bytearray.Length); totalBytesRead += bytesRead; } while (bytesRead > 0); fileToupload.Write(bytearray, 0, bytearray.Length); fileToupload.Close(); fileToupload.Dispose(); }
public interface IImageUpload { [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "FileUpload/{fileName}")] void upload(string fileName, Stream fileStream); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)