![]() ![]() For File upload scenarios, we are using WebInvoke with POST method.Also, in file download, we need to add some header info like Content-disposition and Content-Type to the outgoing response in order for the consuming client to understand the file.For file download scenarios, we are using the WebGet attribute, indicating that it is indeed a get Call for a file on the server. ![]() While ((readCount = stream.Read(buffer, 0, buffer.Length)) != 0)Ī few things to note from the above piece of code are as follows: Using (FileStream writer = new FileStream(FilePath, FileMode.Create)) (HostingEnvironment.MapPath( " ~/FileServer/Uploads"), fileName) Public void UploadFile( string fileName, Stream stream) String headerInfo = " attachment filename=" + fileName + ". ( " ~/FileServer/Extracts"), fileName + ". Public Stream DownloadFile( string fileName, string fileExtension) Public class FileUploadServ : IFileUploadServ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |