While ((readCount = stream.Read(buffer, 0, buffer.Length)) != 0)Ī few things to note from the above piece of code : Using ( FileStream writer = new FileStream(FilePath, FileMode.Create)) String FilePath = Path.Combine( HostingEnvironment.MapPath( "~/FileServer/Uploads"), fileName) Public void UploadFile( string fileName, Stream stream) String headerInfo = "attachment filename=" + fileName + "." + fileExtension String downloadFilePath = Path.Combine( HostingEnvironment.MapPath( "~/FileServer/Extracts"), fileName + "." + fileExtension) Public Stream DownloadFile( string fileName, string fileExtension) Public class FileUploadServ : IFileUploadServ Void UploadCustomFile( string fileName, Stream stream) So, to start of with the implementation, we’ll write the service contract code first as shown below : So, I would advice you to go through it to get some context. This article is in continuation of the last one. Here we are going to cover just that part of our service. Last week I blogged about how to create a RESTful service using WCF and how it was to actually not learn anything in order to make your existing WCF service RESTful.Ĭonverting a normal WCF service to being RESTful might be an easy task, but when it comes to streaming files over a REST call using WCF, it might get a little tricky.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |