FtpHelperUpload Method
上傳檔案
Namespace: eBizprise.Framework.FtpHelperAssembly: eBizprise.Framework.FtpHelper (in eBizprise.Framework.FtpHelper.dll) Version: 25.0.3.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
public ApiResult Upload(
string fileName,
byte[] fileContents
)
- fileName String
- 檔案名
- fileContents Byte
- 資料
ApiResultApiResult
string FileName = TargetFile;
using Stream fileStream = File.OpenRead(TargetPath + FileName);
Assert.IsNotNull(fileStream.Position, "讀取檔案失敗");
byte[] bytes = new byte[fileStream.Length];
fileStream.Read(bytes, 0, bytes.Length);
ApiResult result = new FtpHelper().Upload(FileName, bytes);
Assert.IsTrue(result.IsSuccess, "上傳失敗");
| Date | Version | Description |
|---|
| 2021/06/08 | 1.0.0.0 | 初版 |
| 2021/07/21 | 1.0.1.0 | 調整連接埠設定資料類型為int |
| 2025/09/19 | 25.0.0.0 | 彙整2025年度初版 |
| 2025/11/24 | 25.0.2.0 | 調整設定值可由設定檔取得或自訂 |
| 2025/11/27 | 25.0.3.0 | 改用FluentFTP重構,移除已過時的FtpWebRequest |