-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPostedFile.cs
46 lines (40 loc) · 1.09 KB
/
PostedFile.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.IO;
namespace Inversion.Web {
/// <summary>
/// Represents a file that was posted as part of a http request.
/// </summary>
public class PostedFile : IRequestFile {
private readonly string _fileName;
private readonly string _contentType;
private readonly Stream _content;
/// <summary>
/// The name of the file.
/// </summary>
public string FileName {
get { return _fileName; }
}
/// <summary>
/// The content type for the file.
/// </summary>
public string ContentType {
get { return _contentType; }
}
/// <summary>
/// The actual content of the file.
/// </summary>
public Stream Content {
get { return _content; }
}
/// <summary>
/// Instantiates a new posted file object.
/// </summary>
/// <param name="name">The name of the file.</param>
/// <param name="contentType">The content type of this file.</param>
/// <param name="content">The content for this file.</param>
public PostedFile(string name, string contentType, Stream content) {
_fileName = name;
_contentType = contentType;
_content = content;
}
}
}