Jump to content

FTP Automation


Recommended Posts

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
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

;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
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...