UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Ftp Won't Connect Using Certain Methods, Any Versions    
 
   
JonSmith
post Jul 4 2018, 02:44 AM
Post#1



Posts: 3,956
Joined: 19-October 10



Hi,

So we use a fair few FTP's at my new job.
I ended up writing a bunch a classes to handle it in VBA using the wininet.dll API calls. It works great.

I have also started looking at some options in Powershell as we have some .BAT files that use the 'ftp' command but I want to integrate them into a larger Powershell routine that also handles to files downloaded from FTP after getting them.

Using 2 of the FTP connections Powershell works without issue, the third, which is the one I need to work, just times out any time I try to connect with it. I can get it work with my VBA code or with the .bat file ftp method though so I know I have the correct details.
The only noticeable difference from the outside to me is that the two that work have FTP addresses like ftp.companyname.com whereas the one that doesn't work is 173.458.245.01 (Obviously fake numbers replacing the real ones).

Does that clue anyone in who knows more about FTP why one is failing but the other two aren't? Is there some other setting I might be missing such as the connection type being a factor?

I'll share the Powershell code I can get to work with two but not the third if that helps?

JS
Go to the top of the page
 
cheekybuddha
post Jul 4 2018, 03:58 AM
Post#2


UtterAccess VIP
Posts: 10,538
Joined: 6-December 03
From: Telegraph Hill


Does the third work on a non-standard port?
Go to the top of the page
 
JonSmith
post Jul 4 2018, 04:41 AM
Post#3



Posts: 3,956
Joined: 19-October 10



I David,

So I might have made it confusing in my own description but are you referring to the third methodology or the third FTP?

Method 1 - VBA
Method 2 - Command Line FTP
Method 3 - Powershell

FTP 1 - Normal FTP address
FTP 2 - Normal FTP Address
FTP 3 - IP address.

FTP 1 and FTP 2 work with all 3 methods.
FTP 3 only works with Method 1 and Method 2.
Go to the top of the page
 
cheekybuddha
post Jul 4 2018, 05:05 AM
Post#4


UtterAccess VIP
Posts: 10,538
Joined: 6-December 03
From: Telegraph Hill


FTP normally works over port 21, but this can be set differently on the server.

There is no real difference between using a domain name like ftp.companyname.com and an IP address - domain names resolve to IP addresses anyway.

What happens if you try and connect to the IP server directly in Powershell? Does it output anything in the console to give a better idea of what's happening?

Go to the top of the page
 
JonSmith
post Jul 4 2018, 05:55 AM
Post#5



Posts: 3,956
Joined: 19-October 10



So using the FTP code with the IP address it just hangs and gives a gateway timeout error.
I'm going to try and get the IP address of the FTP's and try them in all 3 methods to see if they work.

JS

Edit, just got the IP address of FTP 1 and it works with all 3 methods. So I think this is an issue with the FTP 3 and not the IP address. Thanks for your help David.
I'll see if I can find out anything about that server and who manages it.
This post has been edited by JonSmith: Jul 4 2018, 06:00 AM
Go to the top of the page
 
cheekybuddha
post Jul 4 2018, 06:45 AM
Post#6


UtterAccess VIP
Posts: 10,538
Joined: 6-December 03
From: Telegraph Hill


thumbup.gif

It's rare to use vanilla FTP these days due to security.

Perhaps FTP3 is using FTPS and you need to be able to handle the TLS handshake connection protocol, but I would imagine Powershell would have that built-in. dontknow.gif

d
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    13th November 2018 - 11:44 AM