Jump to content

Download multiple files from FTP


furrycow
 Share

Recommended Posts

Hey, im trying to download multiple items from my ftp and have realised that if you log into your ftp, all the files show as hyperlinks, so thought this would be an easy to get all the files and to put them in the script directory

I've written all the necessary stuff beforehand for this to work....

For $oLink In $oLinks
Sleep(100)
Tooltip("Status: Link Number (" &$link& ")", 0, 0, "****** RUNNING ******")
InetGet ($oLink.href,@ScriptDir,1, 0) 
$link=$link+1
Sleep(500)
EndIf
Next

Just, how would i get it to cycle through every file and put every file in the same directory...at the moment, with this code, it downloads them, put doesnt put them anywhere, (theyre not in the directory)...the only time it actually downloads the a file is when i write...

InetGet ($oLink.href,@ScriptDir,1, 0) 

as

InetGet ($oLink.href,C:\file.exe,1, 0)

And even then it is only the last "$oLink.href" file that is in the directory...

So, my question is...is there anyway of downloading them with their current file names as determined on the ftp server, and to actually download all the files on there, not just the last one.

Thank you in advance!

Edited by furrycow
Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

Hey, im trying to download multiple items from my ftp and have realised that if you log into your ftp, all the files show as hyperlinks, so thought this would be an easy to get all the files and to put them in the script directory

I've written all the necessary stuff beforehand for this to work....

For $oLink In $oLinks
Sleep(100)
Tooltip("Status: Link Number (" &$link& ")", 0, 0, "****** RUNNING ******")
InetGet ($oLink.href,@ScriptDir,1, 0) 
$link=$link+1
Sleep(500)
EndIf
Next

Just, how would i get it to cycle through every file and put every file in the same directory...at the moment, with this code, it downloads them, put doesnt put them anywhere, (theyre not in the directory)...the only time it actually downloads the a file is when i write...

InetGet ($oLink.href,@ScriptDir,1, 0) 

as

InetGet ($oLink.href,C:\file.exe,1, 0)

And even then it is only the last "$oLink.href" file that is in the directory...

So, my question is...is there anyway of downloading them with their current file names as determined on the ftp server, and to actually download all the files on there, not just the last one.

Thank you in advance!

The line

InetGet ($oLink.href,@ScriptDir,1, 0)

looks wrong to me as it will download the file to a local file called @ScriptDir.

To find the files and copy them you need to use these _ftp functions

To get the list of files

_FTPFileFindFirst, _FTPFileFindNext, _FTPFileFindClose

OR

_FTPListFiles

to download the files

_FTPGetFile

OR

InetGet

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

The line

InetGet ($oLink.href,@ScriptDir,1, 0)

looks wrong to me as it will download the file to a local file called @ScriptDir.

To find the files and copy them you need to use these _ftp functions

To get the list of files

_FTPFileFindFirst, _FTPFileFindNext, _FTPFileFindClose

OR

_FTPListFiles

to download the files

_FTPGetFile

OR

InetGet

Thanks for the reply, and ive just tried coding but i have no _FTP functions :S. I have the latest AutoIT, is there some little thing im missing??

Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

Thanks for the reply, and ive just tried coding but i have no _FTP functions :S. I have the latest AutoIT, is there some little thing im missing??

The ftp includes do not come with AutoIt so you have to search. There is a well used one in example scripts sticky by wouter.

I use this which is a collection from various places.

ftpplus.au3

If you need some help getting started just shout.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...