Beispiel #1
0
        /// <summary>
        /// 上传可以Append的文件
        /// </summary>
        /// <param name="storageNode">GetStorageNode方法返回的存储节点</param>
        /// <param name="contentByte">文件内容</param>
        /// <param name="fileExt">文件扩展名(注意:不包含".")</param>
        /// <returns>文件名</returns>
        public static string UploadAppenderFile(StorageNode storageNode, byte[] contentByte, string fileExt)
        {
            FDFSRequest storageReqeust = UPLOAD_APPEND_FILE.Instance.GetRequest(storageNode.EndPoint, storageNode.StorePathIndex, contentByte.Length, fileExt, contentByte);

            UPLOAD_APPEND_FILE.Response storageResponse = new UPLOAD_APPEND_FILE.Response(storageReqeust.GetResponse());
            return(storageResponse.FileName);
        }
Beispiel #2
0
 public static async Task <string> UploadAppenderFileAsync(StorageNode storageNode, byte[] contentByte, string fileExt)
 {
     UPLOAD_APPEND_FILE.Response response =
         new UPLOAD_APPEND_FILE.Response(
             await UPLOAD_APPEND_FILE.Instance.GetRequest(new object[]
                                                          { storageNode.EndPoint, storageNode.StorePathIndex, contentByte.Length, fileExt, contentByte })
             .GetResponseAsync());
     return(response.FileName);
 }
 /// <summary>
 /// 上传可以Append的文件
 /// </summary>
 /// <param name="storageNode">GetStorageNode方法返回的存储节点</param>
 /// <param name="contentByte">文件内容</param>
 /// <param name="fileExt">文件扩展名(注意:不包含".")</param>
 /// <returns>文件名</returns>
 public static string UploadAppenderFile(StorageNode storageNode, byte[] contentByte, string fileExt)
 {
     FDFSRequest storageRequest = UPLOAD_APPEND_FILE.Instance.GetRequest(storageNode.EndPoint, storageNode.StorePathIndex, contentByte.Length, fileExt, contentByte);
     UPLOAD_APPEND_FILE.Response storageResponse = new UPLOAD_APPEND_FILE.Response();
     storageRequest.GetResponse(storageResponse);
     return storageResponse.FileName;
 }