This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathFileUploadStatus.cs
136 lines (121 loc) · 3.55 KB
/
FileUploadStatus.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
using System.IO;
namespace DNNConnect.CKEditorProvider.Objects
{
/// <summary>
/// FileUploadStatus Class
/// </summary>
public class FilesUploadStatus
{
/// <summary>
/// The handler path
/// </summary>
public const string HandlerPath = "/";
/// <summary>
/// Initializes a new instance of the <see cref="FilesUploadStatus"/> class.
/// </summary>
public FilesUploadStatus()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="FilesUploadStatus"/> class.
/// </summary>
/// <param name="fileInfo">The file information.</param>
public FilesUploadStatus(FileInfo fileInfo)
{
SetValues(fileInfo.Name, (int)fileInfo.Length);
}
/// <summary>
/// Initializes a new instance of the <see cref="FilesUploadStatus"/> class.
/// </summary>
/// <param name="fileName">Name of the file.</param>
/// <param name="fileLength">Length of the file.</param>
public FilesUploadStatus(string fileName, int fileLength)
{
SetValues(fileName, fileLength);
}
/// <summary>
/// Gets or sets the group.
/// </summary>
/// <value>
/// The group.
/// </value>
public string group { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string name { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>
/// The type.
/// </value>
public string type { get; set; }
/// <summary>
/// Gets or sets the size.
/// </summary>
/// <value>
/// The size.
/// </value>
public int size { get; set; }
/// <summary>
/// Gets or sets the progress.
/// </summary>
/// <value>
/// The progress.
/// </value>
public string progress { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>
/// The URL.
/// </value>
public string url { get; set; }
/// <summary>
/// Gets or sets the thumbnail_url.
/// </summary>
/// <value>
/// The thumbnail_url.
/// </value>
public string thumbnail_url { get; set; }
/// <summary>
/// Gets or sets the delete_url.
/// </summary>
/// <value>
/// The delete_url.
/// </value>
public string delete_url { get; set; }
/// <summary>
/// Gets or sets the delete_type.
/// </summary>
/// <value>
/// The delete_type.
/// </value>
public string delete_type { get; set; }
/// <summary>
/// Gets or sets the error.
/// </summary>
/// <value>
/// The error.
/// </value>
public string error { get; set; }
/// <summary>
/// Sets the values.
/// </summary>
/// <param name="fileName">Name of the file.</param>
/// <param name="fileLength">Length of the file.</param>
private void SetValues(string fileName, int fileLength)
{
name = fileName;
type = "image/png";
size = fileLength;
progress = "1.0";
url = string.Format("{0}FileTransferHandler.ashx?f={1}", HandlerPath, fileName);
}
}
}