Hi.
I want to download or upload a text file or executable file from a ftp site.
So I am using wininit.dll to do this task.
I use FtpPutFile and FtpGetFile method.
But a small bug really failing this whole codeblock. So I really wish your help to fix this code blocks.
When I run this code in my Meta Trader terminal, this is what is happening:
1) I get to initiate an internet object successfully.
2) I am only able to get to log in of http site in fact not ftp site using my username and password. This is good news at least but also strategy cause I can't get connect to my ftp site.
3) but once I have loged into http site instead of ftp site. I am failing to download or upload file.
Thanks in advance for your sharing your thoughts. Below is the entire code block.
Kind regards.
No idea if your code is correct, but I would expect FTP values in the InternetConnect.
hIntObjConn=InternetConnectW(hIntObj, ServerName, INTERNET_DEFAULT_FTP_PORT, UserName, Password, INTERNET_SERVICE_FTP, 0, 0);
No idea if your code is correct, but I would expect FTP values in the InternetConnect.
hIntObjConn=InternetConnectW(hIntObj, ServerName, INTERNET_DEFAULT_FTP_PORT, UserName, Password, INTERNET_SERVICE_FTP, 0, 0);
Yes, you are correct.
hIntObjConn=InternetConnectW(hIntObj, ServerName, INTERNET_DEFAULT_FTP_PORT, UserName, Password, INTERNET_SERVICE_FTP, 0, 0);
I tried this code and it did not work. I have entered correct ftp user name and password too as I checked them probably more than five times.
But never had any success with Meta Trader terminal so far.
But using C sharp in another c sharp application, using WebClient method, I could login to the same ftp site. Plus I was able to download and upload the file without any problem.
So the ftp site details can't be wrong, I guess.
using (WebClient client = new WebClient())
Just to provide more inforamtion.
I used the same ftp site address, user name and password on Meta Trader Terminal FTP tab.
I also got these errors. What does this mean ?
2016.01.21 21:54:48.311 Publisher: error connecting to ftp://testserver.co.uk 2016.01.21 22:12:38.944 FTP: cannot determine host address [ftp] 2016.01.21 22:12:32.151 Publisher: starting
Just to provide more inforamtion.
I used the same ftp site address, user name and password on Meta Trader Terminal FTP tab.
I also got these errors. What does this mean ?
More interesting is that this server works for you with c#. How did you set it for the c#, as it does not seem to have any dns record.
More interesting is that this server works for you with c#. How did you set it for the c#, as it does not seem to have any dns record.
Yes, C sharp, WebClient method is somehow designed for ftp file upload and download. Therefore, it did work pretty well. I guess.
But WinInet.dll seems to have little problem in initiating ftp connection inside Meta Trader Terminal.
Hope there are some MQL native ftp connection method to be developed from some knowledgable coders. :)
I am not the best anyway on ftp topics.
Kind regards.
Yes, C sharp, WebClient method is somehow designed for ftp file upload and download. Therefore, it did work pretty well. I guess.
But WinInet.dll seems to have little problem in initiating ftp connection inside Meta Trader Terminal.
Hope there are some MQL native ftp connection method to be developed from some knowledgable coders. :)
I am not the best anyway on ftp topics.
Kind regards.
Both the WebRequest and C# WebClient very probably use the wininet.dll finally. So the question remains, how did you manage to connect to the site, which is not listed in DNS (via the C#)? Cause it makes it mysterious for me.
You could probably right. In fact, I am just checking that the ftp site give me error with Webclient too which did not happen before. It only happens after the New year. I guess they have changed the setting for their ftp site.
Quite possible. Thanks for letting me know any way.
Kind regards.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi.
I want to download or upload a text file or executable file from a ftp site.
So I am using wininit.dll to do this task.
I use FtpPutFile and FtpGetFile method.
But a small bug really failing this whole codeblock. So I really wish your help to fix this code blocks.
When I run this code in my Meta Trader terminal, this is what is happening:
1) I get to initiate an internet object successfully.
2) I am only able to get to log in of http site in fact not ftp site using my username and password. This is good news at least but also strategy cause I can't get connect to my ftp site.
3) but once I have loged into http site instead of ftp site. I am failing to download or upload file.
Thanks in advance for your sharing your thoughts. Below is the entire code block.
Kind regards.