Skip to content

Commit 8ae3ce8

Browse files
committed
Merge pull request #88 from liangchaoboy/addDeleteAfterDays
addDeleteAfterDays
2 parents 45319cc + 6f326d2 commit 8ae3ce8

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

Qiniu/RS/PutPolicy.cs

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class PutPolicy
3232
private string callbackHost;
3333
private string callbackBodyType;
3434
private int callbackFetchKey;
35+
private int deleteAfterDays;
3536

3637
/// <summary>
3738
/// 一般指文件要上传到的目标存储空间(Bucket)。若为”Bucket”,表示限定只能传到该Bucket(仅限于新增文件);若为”Bucket:Key”,表示限定特定的文件,可修改该文件。
@@ -137,26 +138,26 @@ public int DetectMime {
137138
}
138139
}
139140

140-
/// <summary>
141-
/// 限定用户上传的文件类型
142-
/// 指定本字段值,七牛服务器会侦测文件内容以判断MimeType,再用判断值跟指定值进行匹配,匹配成功则允许上传,匹配失败返回400状态码
143-
/// 示例:
144-
///1. “image/*“表示只允许上传图片类型
145-
///2. “image/jpeg;image/png”表示只允许上传jpg和png类型的图片
146-
/// </summary>
147-
/// <value>The detect MIME.</value>
148-
[JsonProperty("mimeLimit")]
149-
public string MimeLimit
150-
{
151-
get
152-
{
153-
return mimeLimit;
154-
}
155-
set
156-
{
157-
mimeLimit = value;
158-
}
159-
}
141+
/// <summary>
142+
/// 限定用户上传的文件类型
143+
/// 指定本字段值,七牛服务器会侦测文件内容以判断MimeType,再用判断值跟指定值进行匹配,匹配成功则允许上传,匹配失败返回400状态码
144+
/// 示例:
145+
///1. “image/*“表示只允许上传图片类型
146+
///2. “image/jpeg;image/png”表示只允许上传jpg和png类型的图片
147+
/// </summary>
148+
/// <value>The detect MIME.</value>
149+
[JsonProperty("mimeLimit")]
150+
public string MimeLimit
151+
{
152+
get
153+
{
154+
return mimeLimit;
155+
}
156+
set
157+
{
158+
mimeLimit = value;
159+
}
160+
}
160161

161162
/// <summary>
162163
/// 可选, Gets or sets the fsize limit.
@@ -243,6 +244,15 @@ public int CallbackFetchKey
243244
set { callbackFetchKey = value; }
244245
}
245246

247+
248+
/// <summary>
249+
/// 文件在多少天后被删除,七牛将文件上传时间与指定的deleteAfterDays天数相加,得到的时间入到后一天的午夜(CST,中国标准时间),从而得到文件删除开始时间。例如文件在2015年1月1日上午10:00 CST上传,指定deleteAfterDays为3天,那么会在2015年1月5日00:00 CST之后当天内删除文件
250+
/// </summary>
251+
public int DeleteAfterDays
252+
{
253+
get { return deleteAfterDays; }
254+
set { deleteAfterDays = value; }
255+
}
246256
/// <summary>
247257
/// Initializes a new instance of the <see cref="Qiniu.RS.PutPolicy"/> class.
248258
/// </summary>

0 commit comments

Comments
 (0)