Hi folks,
I've got a lot of requests from my friends the members of forex-tsd forum asking me to make a better version of MetaTrader FTP sending.
I hope you find this tool useful and better than the SendFTP() MQL4 function!
Our dll today have 5 functions:
string gConnect(string FTPServer,string user,string pass,string path="ROOT");
You have to use this function to connect to the FTP server before uploading or downloading files to it.
The first parameter is the FTP server, the second parameter is the User name, the third parameter is the Password and the fourth parameter is the directory path on the ftp server you want to upload or download from.
Note: If you want to upload/download from the root of the ftp server you have to set path parameter to "ROOT".
The function will return a string, it returns the error message if there's any or it return "Connected" if there's no error!
Example:
string result = gConnect("FTP SERVER","USER NAME","PASSWORD","ROOT");
string gSendFile(string file_name);
Now you have a connection to the FTP server. You can upload the file you want to the server using this function.
The only parameter of this function is the path and the name of the file you want to upload.
Example:
string result = gSendFile("C:\\image.jpg");
string gGetFile(string remote_file_name, string local_file_name)
If you want to download a file from the FTP server you have to use this function (You have to connect to the server before using gSendFile and gGetFile functions).
The first parameter is the name of the file on the FTP server you want to download. The second parameter is the path and file name you want to save the downloaded file to.
Example:
string result = gGetFile("image.jpg","C:\\image.jpg");
string gClose()
When you finish your work with the FTP sever you have to use this function to close the connection to the FTP server.
Example:
string result = gClose();
string gFTP(string FTPServer,string user,string pass, string file_name)
To make the life easier I've added this function to connect and upload a file to the FTP server then close the connection.
So, You can use this function alone without gConnect and gClose.
The first parameter is the FTP server, the second parameter is the User name, the third parameter is the Password,the fourth parameter is the directory path on the ftp server you want to upload or download from and the fifth parameter is the path of the file you want to upload.
Example:
string result = gConnect("FTP SERVER","USER NAME","PASSWORD","ROOT","C:\\image.jpg");
Tools - Forex-tsd forum new posts notifier!