Jump to content

FTP problems


Recommended Posts

Some background information:

I have a FileZilla FTP Server running on my computer.

I also have the No-IP client running.

I have port 21 (ftp) forwarded.

My script:

#include <FTPEx.au3>
#include <File.au3>

$ftpServer = "blahblah.no-ip.org"
$ftpUsername = "blahblah"
$ftpPassword = "blahblah"
$File = "Test.txt"

$ftpOpen = _FTP_Open("blahblah")

$ftpConnect = _FTP_Connect($ftpOpen, $ftpServer, $ftpUsername, $ftpPassword)
$Upload = _FTP_FilePut($ftpConnect, $File, $File)

_FTP_Close($ftpOpen)

The console output in FileZilla Server:

> Connected, sending welcome message...
> 220 Hello
> USER blahblah
> 331 Password required for blahblah
> PASS ********
> 230 Logged on
> TYPE I
> 200 Type set to I
> PORT 192,168,1,2,203,229
> 200 Port command successful
> STOR Test.txt
> 150 Opening data channel for file transfer.
> 425 Can't open data connection.
> disconnected.

My question is, why is the data connection not opening? I read some articles on this problem and all I didn't get much from them.

I've also read this, but don't know what to change in my script. If anybody could help that would be great.

Network Configuration

Link to comment
Share on other sites

My question is, why is the data connection not opening? I read some articles on this problem and all I didn't get much from them.

I've also read this, but don't know what to change in my script. If anybody could help that would be great.

Network Configuration

Maybe I'm wrong but I think the problem is not in your script but in your Filezilla server configuration. Take a look to this part on Filezilla doc. Configure your server in pasive mode, open a few ports (50000-50005) and forward them like you did with port 21 and try the script again.

Regards,

sahsanu

Link to comment
Share on other sites

Hmm...I have:

*set the Server's Passive Port range to 50,000 - 50,050.

*port forwarded these addresses for TCP and UDP.

*set the External IP to "Get from this address: http://ip.filezilla-project.org/ip.php"

Is there anything else I can try? I have even tried turning off my router's firewall, and it still wouldn't accept the data connection. In the server, it would show up for a split second before being rejected, with almost 1 kb being sent over.

Edited by darkjohn20
Link to comment
Share on other sites

Do I need to do UDP as well? Is there anything else I can try?

No, you don't need to forward UDP ports. I tried your script against my FTP server and works very fine, it uploads the file without any problem so seems the issue is on your side. Do you have any firewall on your computer?. If the answer is yes the you should also allow these ports (50.000-50.100) for incoming connections.

Just a question, are you trying to reach your ftp server executing the script on the same computer the server is running?. Again, if the answer is yes then it won't work because your router will forward only external incoming connections. Did you try to run your script against localhost instead your no-ip domain?.

Link to comment
Share on other sites

I have all firewalls on my computer configured correctly. Windows Firewall is off.

Yes, I've been running the server on this computer AND running my script on the same computer.

My script worked yesterday when I had used localhost for both.

So, you mean that if I tried it on another computer it would work? (My AutoIt script that is)

Edited by darkjohn20
Link to comment
Share on other sites

Yes, I've been running the server on this computer AND running my script on the same computer.

My script worked yesterday when I had used localhost for both.

Then that is the reason why your script doesn't work using your external ip, as I said, you router will forward connections to your ftp server only if they are coming to the external interface of your router. Tell a friend to try your script and you will see how it works ;-)

Cheers,

sahsanu

Link to comment
Share on other sites

Hmm...It seems to have worked a little better, but my friend said that his firewall stopped it. He doesn't really know what to do to fix it, as he isn't very computer literate. Is there any way I can ask if he wants to disable it temporarily, and if he accepts, run this? I'm not sure how else I could easily teach the people who use my script to do this. :idea:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...