Jump to content
Sign in to follow this  
henry1

FTP Automation

Recommended Posts

henry1

Hi all,

I want to know if I can create a FTP Windows automation (login with user id and password) automatically and then get the file from the FTP address? Is there any FTP built in function from AutoIt? Thank

Thank you for help and hints.

Henry


Henry

Share this post


Link to post
Share on other sites
Skruge

If you only need to download files, InetGet is cabable.

You can embed the credentials in the URL parameter. For example: "ftp://username:password@ftp.website.com/path/file.ext"

If you need to upload files as well, search the forums for one of the FTP UDF's.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
henry1

Hi,

If you only need to download files, InetGet is cabable.

You can embed the credentials in the URL parameter. For example: "ftp://username:password@ftp.website.com/path/file.ext"

For now, I just want to get the file. So, for example, if it's local address, e.g: 10.1.1.10, could it be applied?

Thank you.


Henry

Share this post


Link to post
Share on other sites
felanor

Hi,

For now, I just want to get the file. So, for example, if it's local address, e.g: 10.1.1.10, could it be applied?

Thank you.

Hi Henry,

If you are looking to simply get the file using INetGet, you could do it like this:

;This section here are the variables to be used in the INetGet command for pulling your files.
$username = "Username"; This is the username for your server.
$password = "Password"; This is the password for your user on the server.
$server = "10.1.1.10"; This is your server's address, in your case, 10.1.1.10
$filepath = "path/file.ext"; This is the path from your FTP server to the file you want to get.
$saveas = FileSaveDialog("Save As...", @DesktopDir, "All Files(*.*)" , 18); This is the path that you will be saving the file from the FTP server.

INetGet("ftp://" & $username & ":" & $password & "@" & $server & "/" & $filepath, $saveas, 1, 0); This will download the file specified in the variable above.

Hope this helps.

~Felanor

Share this post


Link to post
Share on other sites
henry1

;This section here are the variables to be used in the INetGet command for pulling your files.
$username = "Username"; This is the username for your server.
$password = "Password"; This is the password for your user on the server.
$server = "10.1.1.10"; This is your server's address, in your case, 10.1.1.10
$filepath = "path/file.ext"; This is the path from your FTP server to the file you want to get.
$saveas = FileSaveDialog("Save As...", @DesktopDir, "All Files(*.*)" , 18); This is the path that you will be saving the file from the FTP server.

INetGet("ftp://" & $username & ":" & $password & "@" & $server & "/" & $filepath, $saveas, 1, 0); This will download the file specified in the variable above.

Hope this helps.

~Felanor

Hi Felanor,

Thank you for your help. I tried your coding and it seemed it did not work. It will who the FileSaveDialog and after I specified the location and save, it did not save anything. My question is will this function work for AIX machine? For your information, on regular Windows system, I will type, e.g: ftp <10.1.1.10>. Then I will login under the ID and password given. After that, I will execute get command, e.g: get File1 (this file is located under home directory)

And I can see my "File1" on my local drive. So, the script would be:

;This section here are the variables to be used in the INetGet command for pulling your files.
$username = "Username"; This is the username for your server.
$password = "Password"; This is the password for your user on the server.
$server = "10.1.1.10"; This is your server's address, in your case, 10.1.1.10
$filepath = "File1"; This is the path from your FTP server to the file you want to get.
$saveas = FileSaveDialog("Save As...", @DesktopDir, "All Files(*.*)" , 18); This is the path that you will be saving the file from the FTP server.

INetGet("ftp://" & $username & ":" & $password & "@" & $server & "/" & $filepath, $saveas, 1, 0); This will download the file specified in the variable above.

Is there something I am missing?

EDIT:

I tried to open on the browser with

ftp://username:password@10.1.1.10/File1
and it will show the File1 content. However, when I tried to use InetGet, it did not save anything. Edited by henry1

Henry

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.