FTPUpload.cs
API Requirement
API description
/*
* parameter
* 1. getFTPuser : ftp user name
* 2. getFTPPwd : user password
* 3. getFTPFullUpdPath : upload file path on ftp server
* 4. getFTPFullLocalPath : local file for upload
* 5. getDataString : string data type for upload
* 6. getCSFlag : do checksum flag
* 7. getReTryCount : count of retrying to upload
* 8. getUploadFromFile : the data content is from file or from string
*/
public FTPUpload(
String getFTPuser,
String getFTPPwd,
String getFTPFullUpdPath,
String getFTPFullLocalPath
)
public FTPUpload(
String getFTPuser,
String getFTPPwd,
String getFTPFullUpdPath,
String getFTPFullLocalPath,
bool getCSFlag
)
public FTPUpload(
String getFTPuser,
String getFTPPwd,
String getFTPFullUpdPath,
String getFTPFullLocalPath,
int getReTryCount,
bool getCSFlag
)
public FTPUpload(
String getFTPuser,
String getFTPPwd,
String getFTPFullUpdPath,
String getDataString,
int getReTryCount,
bool getUploadFromFile,
bool getCSFlag
)
- start to upload through FTP (開始 FTP 上傳)
public int startFTPUpload()
API Example
- Example.1 : upload a string to ftp server
FTPUpload fd = new FTPUpload("user", "pwd", "ftp://xyz:21/example.txt", "Data test", 10, false, true);
int fdStatus = fd.startFTPUpload();
Console.WriteLine(String.Format("a{0}", fdStatus));
- Example.2 : upload from a file to ftp server in detailed settings
FTPUpload fd = new FTPUpload("user", "pwd", "ftp://xyz:21/example.txt", "C:/Users/user1/Desktop/example1.txt", true);
int fdStatus = fd.startFTPUpload();
Console.WriteLine(String.Format("a{0}", fdStatus));