Posts

Showing posts from 2016

Agile in a Nutshell

Image
Agile software development describes a set of principles for software development under which requirements and solutions evolve through the collaborative effort of self-organizing cross-functional teams.It advocates adaptive planning, evolutionary development, early delivery, and continuous improvement, and it encourages rapid and flexible response to change.These principles support the definition and continuing evolution of many software development methods.

How to resolve file corruption after upload through WCF Service.

Recently I Implemented a WCF  Service to upload files. Implementation was fine and even file save to given location successfully, but  when I try to open these files I got error messages saying that the file is not encoded properly or file is too large to open. After searching I got a sample code to overcome that issue. You can check original Implementation in here  http://multipartparser.codeplex.com/ . Thanks Anthony for awesome code implementation.  

Upload Files using WCF Rest Service

1. Interface Class [ServiceContract] public interface IUpload { /// <summary> /// Upload, runs synchronously service side . /// </ summary > /// < param name="token">An application arbitrary piece of data. Can be used for request obfuscation.</ param > /// < param name="data">The data being uploaded.</param> [OperationContract] [WebInvoke(UriTemplate = "upload/{token}", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] void Upload(string token, Stream data); } 2. Service Implementation Class public class UploadDataService : IUpload { public void Upload(string token, Stream data) { StreamToFile(data); } private void StreamToFile(Stream data) { // get full path to and create the directory to save file in ...