|
4 | 4 |
|
5 | 5 | 此 SDK 适用于 .NET4 及以上版本。 |
6 | 6 |
|
7 | | -SDK下载地址:[https://github.com/qiniu/csharp-sdk](https://github.com/qiniu/csharp-sdk) |
| 7 | +SDK下载地址:[https://github.com/qiniu/csharp-sdk/tags](https://github.com/qiniu/csharp-sdk/tags) |
8 | 8 |
|
9 | 9 |
|
10 | 10 | **应用接入** |
@@ -62,10 +62,10 @@ SDK下载地址:[https://github.com/qiniu/csharp-sdk](https://github.com/qiniu |
62 | 62 |
|
63 | 63 | // 首先定义资源表名 |
64 | 64 | string tableName = "tableName"; |
65 | | - |
| 65 | + |
66 | 66 | // 然后获得签名认证 |
67 | 67 | DigestAuthClient conn = new DigestAuthClient(); |
68 | | - |
| 68 | + |
69 | 69 | // 签名认证完成后,即可使用该认证来新建资源表 |
70 | 70 | RSService rs = new RSService(conn, tableName); |
71 | 71 |
|
@@ -94,25 +94,25 @@ SDK下载地址:[https://github.com/qiniu/csharp-sdk](https://github.com/qiniu |
94 | 94 |
|
95 | 95 | // 调用资源表对象的 PutFile() 方法进行文件上传 |
96 | 96 | PutFileRet putFileRet = rs.PutFile(key, mimeType, filePath, customMeta); |
97 | | - |
| 97 | + |
98 | 98 | ##### 2. 客户端上传 |
99 | | - |
| 99 | + |
100 | 100 | 因为服务器端已经在之前进行过签名认证持有相应的安全凭证,因此可以直接进行上传。而由于客户端并不持有对RS的安全凭证,所以需要获取上传授权,从而得到一个有上传权限的URL,参见[获得上传授权](#rs-PutAuth)。在获得上传授权URL后,就可以开始上传文件了,示例代码如下: |
101 | 101 |
|
102 | 102 | // 在客户端上传文件之前,需要获得上传授权,得到经过授权的临时URL |
103 | 103 | PutAuthRet putAuthRet = rs.PutAuth(); |
104 | 104 | uploadUrl = putAuthRet.Url; |
105 | | - |
| 105 | + |
106 | 106 | // 通过该临时 URL 进行文件上传 |
107 | | - PutFileRet putFileRet = RSClient.PutFile(uploadUrl, tableName, key, mimeType, |
| 107 | + PutFileRet putFileRet = RSClient.PutFile(uploadUrl, tableName, key, mimeType, |
108 | 108 | filePath, customMeta, callbackParam); |
109 | 109 |
|
110 | 110 | <a name="rs-Stat"></a> |
111 | 111 |
|
112 | 112 | ### 4. 获取已上传文件信息 |
113 | 113 |
|
114 | 114 | 您可以调用资源表对象的 Stat() 方法并传入一个 Key 来获取指定文件的相关信息。 |
115 | | - |
| 115 | + |
116 | 116 | // 获取资源表中特定文件信息 |
117 | 117 | StatRet statRet = rs.Stat(key); |
118 | 118 |
|
|
0 commit comments