Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.53 KB

Readme.md

File metadata and controls

44 lines (28 loc) · 1.53 KB

HQF.Tutorial.FileServer

How To Host The Server

The File Server two way host:

  1. IIS
  2. SelfHost using Owin

Using MulitPart to upload the files

Async

Update the files using asynchonizition

How Deal With The Big Files

var config = new HttpSelfHostConfiguration("http://localhost:8080");

//make the MaxReceivedMessageSize to MaxValue of int.
config.MaxReceivedMessageSize = int.MaxValue;

//Enable the Buffered TransferMode,make it possible to write and receive file at the same time.
config.TransferMode = TransferMode.Buffered;

config.Routes.MapHttpRoute(
    name: "DefaultApi",
    routeTemplate: "api/{controller}/{action}"
);

HttpSelfHostServer server = new HttpSelfHostServer(config);

server.OpenAsync().Wait();

Console.WriteLine("Server Started..");

Resources

HTML5 drag and drop asynchronous multi file upload with ASP.NET WebAPI
Troubleshooting HTTP 405 Errors after Publishing Web API 2 Applications
How to get PUT and DELETE verbs to work with WebAPI on IIS
IIS 7.5 + enable PUT and DELETE for RESTFul service, extensionless