|
1 | | -What is it? |
2 | | -=========== |
| 1 | +# Http Multipart Parser |
| 2 | + |
| 3 | +[](https://httpmultipartparser.mit-license.org/) |
| 4 | + |
| 5 | +[](https://ci.appveyor.com/project/Jericho/http-multipart-data-parser) |
| 6 | + |
| 7 | + |
| 8 | +[](https://coveralls.io/github/Http-Multipart-Data-Parser/Http-Multipart-Data-Parser?branch=master) |
| 9 | +[](https://www.codefactor.io/repository/github/http-multipart-data-parser/http-multipart-data-parser) |
| 10 | + |
| 11 | +| Release Notes| NuGet (stable) | MyGet (prerelease) | |
| 12 | +|--------------|----------------|--------------------| |
| 13 | +| [](https://github.com/http-multipart-data-parser/http-multipart-data-parser/releases) | [](https://www.nuget.org/packages/HttpMultipartParser/) | [](http://myget.org/gallery/jericho) | |
| 14 | + |
| 15 | +## About |
3 | 16 |
|
4 | 17 | The Http Multipart Parser does it exactly what it claims on the tin: parses multipart/form-data. This particular |
5 | 18 | parser is well suited to parsing large data from streams as it doesn't attempt to read the entire stream at once and |
6 | 19 | procudes a set of streams for file data. |
7 | 20 |
|
8 | | -Installation |
9 | | -============= |
10 | | -Simply add the HttpMultipartParser project to your solution and reference it in the projects you want to use it in. |
| 21 | +## Installation |
11 | 22 |
|
12 | | -There is also a NuGet package provided. |
| 23 | +The easiest way to include HttpMultipartParser in your project is by adding the nuget package to your project: |
13 | 24 |
|
14 | | -Dependencies |
15 | | -============ |
16 | | -The parser was built for and tested on NET 4.0. Versions lower then this may work but are untested. |
| 25 | +``` |
| 26 | +PM> Install-Package HttpMultipartParser |
| 27 | +``` |
17 | 28 |
|
18 | | -How do I use it? |
19 | | -================ |
20 | | -## Non-Streaming (Simple, don't use on very large files) |
21 | | -1. Create a new MultipartFormDataParser with the stream containing the multipart/form-data. |
| 29 | +## .NET framework suport |
| 30 | + |
| 31 | +The parser was built for and tested on NET 4.6.1, NET 4,7,2 and NETSTANDARD 2.0. Versions 2.2.4 was the last version of HttpMultipartParser that supported older .NET platforms such as NET 4.5 and NETSTANDARD 1.3. |
| 32 | + |
| 33 | +## Usage |
| 34 | + |
| 35 | +### Non-Streaming (Simple, don't use on very large files) |
| 36 | +1. Parse the stream containing the multipart/form-data by invoking `MultipartFormDataParser.Parse` (or it's asynchronous counterpart `MultipartFormDataParser.ParseAsync`). |
22 | 37 | 2. Access the data through the parser. |
23 | 38 |
|
24 | 39 | ## Streaming (Handles large files) |
25 | 40 | 1. Create a new StreamingMultipartFormDataParser with the stream containing the multipart/form-data |
26 | 41 | 2. Set up the ParameterHandler and FileHandler delegates |
27 | | -3. Call parser.Run() |
| 42 | +3. Call `parser.Run()` (or it's asynchronous counterpart `parser.RunAsync()`) |
28 | 43 | 4. The delegates will be called as data streams in. |
29 | 44 |
|
30 | | -Examples |
31 | | -======== |
| 45 | +## Examples |
32 | 46 |
|
33 | | -Single file |
34 | | ------------ |
| 47 | +### Single file |
35 | 48 |
|
36 | 49 | // stream: |
37 | 50 | -----------------------------41952539122868 |
@@ -81,8 +94,7 @@ Single file |
81 | 94 | // Or you can parse asynchronously: |
82 | 95 | await parser.RunAsync().ConfigureAwait(false); |
83 | 96 |
|
84 | | -Multiple Parameters |
85 | | -------------------- |
| 97 | +### Multiple Parameters |
86 | 98 |
|
87 | 99 | // stream: |
88 | 100 | -----------------------------41952539122868 |
@@ -110,8 +122,7 @@ Multiple Parameters |
110 | 122 | Console.WriteLine("Parameter {0} is {1}", parameter.Name, parameter.Data) |
111 | 123 | } |
112 | 124 |
|
113 | | -Multiple Files |
114 | | ------------ |
| 125 | +### Multiple Files |
115 | 126 |
|
116 | 127 | // stream: |
117 | 128 | -----------------------------41111539122868 |
@@ -162,6 +173,6 @@ Multiple Files |
162 | 173 | // Or you can parse asynchronously: |
163 | 174 | await parser.RunAsync().ConfigureAwait(false); |
164 | 175 |
|
165 | | -Licensing |
166 | | -========= |
| 176 | +## Licensing |
| 177 | + |
167 | 178 | This project is licensed under MIT. |
0 commit comments