Sign in to follow this  
Followers 0
Shyke

Downloading From Ftp

19 posts in this topic

I am not sure what is happening here. I don't seem to be able to find a script to download from FTP and there InetGet doesn't work on this FTP server.

Help?

Share this post


Link to post
Share on other sites



I am not sure what is happening here. I don't seem to be able to find a script to download from FTP and there InetGet doesn't work on this FTP server.

Help?

http://www.autoitscript.com/forum/index.ph...ic=23971&hl=ftp

_FTPGetFile() I believe, his script has it... although I don't think we ever got the progress bar to work.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hmm...

I figure ftpget should work like this:

$Ftgf = _FtpGetFile ($Conn, 'live.txt', 'live.txt')

Does it not?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hmm...

I figure ftpget should work like this:

Does it not?

Your second parameter doesn't look right, there's no path to the file, your 3rd parameter should at leaset have the directory your going to install it on don't you think? Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Same directory.

Share this post


Link to post
Share on other sites

Same directory.

Yeah, but... have you tried giving it the full directory? Better yet... What all have you tried... I was able to get the other example to download myself.... so it must be on your end, or the other.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Alright.

Try to download "live.txt" from "sweangels.no-ip.com:24". Username is "test" and password is "test1".

Share this post


Link to post
Share on other sites

Alright.

Try to download "live.txt" from "sweangels.no-ip.com:24". Username is "test" and password is "test1".

I don't believe you can include the port as part of the domain, you have to include the port as a connection parameter.

You need to use _FTPOpen() to open a sesion then _FTPConnect() to the handle assigned by the $handle = _FTPOpen() call. The port to connect to is a parameter of _FTPConnect(). Use the connection handle $connection = _FTPConnect() for the download operation.

The connect function is documented with the parameters including the port.

Share this post


Link to post
Share on other sites

I try:

$username = "test"

$password = "test1"

$server = "sweangels.no-ip.com:24"

$Open = _FTPOpen ('MyFTP Control')

$Conn = _FTPConnect ($Open, $server, $username, $password)

$Ftgf = _FtpGetFile ($Conn, '/live.txt', 'live.txt')

$Ftpc = _FTPClose ($Open)

And I get nada.

Share this post


Link to post
Share on other sites

I try:

And I get nada.

I repeat:

I don't believe you can include the port as part of the domain, you have to include the port as a connection parameter.

Read the function description in the UDF.

Share this post


Link to post
Share on other sites

Alright, I see... lol.

Further refined:

$username = "test"

$password = "test1"

$server = "sweangels.no-ip.com"

$Open = _FTPOpen ('MyFTP Control')

$Conn = _FTPConnect ($Open, $server, $username, $password, 24)

$Ftgf = _FtpGetFile ($Conn, '/live.ini', 'live.ini', 2, 0, 0, 0)

$Ftpc = _FTPClose ($Open)

No go.

Share this post


Link to post
Share on other sites

$username = "test"

$password = "test1"

$server = "sweangels.no-ip.com"

InetGet("ftp://" & $username & ":" & $password & "@" & $server & "/live.ini", "live.ini", 1, 0)

Is a no go either.

Share this post


Link to post
Share on other sites

do you have a valid username and password to test?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Username: test

Password: test1

The software creates the file that I am trying to get (a 0 byte file) in the directory specified by there never gets to be more then 0 bytes in that file and it just idles until the server d/cs you.

Help?

Share this post


Link to post
Share on other sites

Username: test

Password: test1

The software creates the file that I am trying to get (a 0 byte file) in the directory specified by there never gets to be more then 0 bytes in that file and it just idles until the server d/cs you.

Help?

Try setting the transfer mode to ASC (if it is indeed an ASCII ini file) and if you are behind a firewall/router, set the connection mode to PASSIVE.

Under a normal connection the FTP server initiates the transfer/dialogue, but if you are behind a firewall (router, NAT), the server can't determine your location, so passive mode is used to have the client (your sytem) initiate the dialogue, and the server responds.

I have seen many connection issues due to this with MS FTP.exe since it doesn't support passive transfers.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Heh...

I am gonna have to ask how to set it to passive mode and ASC... I thought it was already in ASC but how can you set it to passive?

$Open = _FTPOpen ('MyFTP Control')
$Conn = _FTPConnect ($Open, $server, $username, $password, 24)
$Ftgf = _FtpGetFile ($Conn, '/live.ini', 'live.ini', 1, 0, 0, 0)
$Ftpc = _FTPClose ($Open)

That even remotely close? lol.

Edited by Shyke

Share this post


Link to post
Share on other sites

Heh...

I am gonna have to ask how to set it to passive mode and ASC... I thought it was already in ASC but how can you set it to passive?

on the _FTPConnect() function set the $l_Flags parameter to 0x08000000, and

in the _FTPGetFile() function set

$l_Flags

; - 1 for transferring the file in ASCII (Type A transfer method) or

; - 2 for transferring the file in Binary (Type I transfer method).

and

$l_Fail - Allow local file to be overwritten if it exists

; - -1 Don't allow overwrite (default)

; - 0 Allow overwrite

The functions have the transfer default as binary, active transfer, and don't overwrite existing file. These are documented in the functions in the udf.

Share this post


Link to post
Share on other sites

YES!

Thank-you very much man guys!!

Share this post


Link to post
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
Sign in to follow this  
Followers 0