LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

FTP session behind a firewall

Hi all, I am developing an application that must transfer some files using ftp but I am getting errors I don't know how to interpret and resolve.
 
I am accessing the internet through a firewall installed in my office, and according to the documentation, I must switch to low level functions if a firewall is present in the connection. My problem is that I receive the error -9 (Cannot connect to FTP server) in InetFTPLogin. Smiley Sad
 
According to this discussion I should use InetFTPSetPassiveMode after the login, but my problem is that I am not able to log in! Smiley Mad
 
If I use the IP of the FTP server instead of standard ftp://ftp...... notation I can connect without problems, but I cannot expect my customer even knows the IP address of its FTP server!
 
I then tried to use Windows API calls (see the sample attached), and I get error 12007 in InternetConnect function even if I use INTERNET_FLAG_PASSIVE flag; this error means:

   12007       ERROR_INTERNET_NAME_NOT_RESOLVED
               The server name could not be resolved.
 
I receive this error both connecting to my ftp server with proper user and password and connecting to an ftp server that accepts anonymous connections using standard "anonymous" + blank-password or "anonymous" + email-address-as-password methods. I can access both servers when using the browser. Even in this case, if I use the IP address the function gets no errors.
 
What can be the error and what can I do to solve it?
Thank you all
 
 

Message Edited by Roberto Bozzolo on 04-03-2006 09:56 AM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 3
(3,965 Views)
Surely InetFTPLogin() takes the plain name of the server, not a URL. So you should specify (for example) "ftp.grotty.com" as the first parameter of InetFTPLogin, not "ftp://ftp.grotty.com".
--
Martin
Certified CVI Developer
Message 2 of 3
(3,953 Views)

Ufff, Martin, you're absolutely right!

Lost in the ocean of parameters and help files I missed this "little" Smiley Surprised detail.

Many thanks for your suggestion. Smiley Wink

BTW, this also applies to InternetConnect API...



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 3
(3,946 Views)