One of the most-requested items in the forums on ScriptingAnswers.com is a way to automate FTP transfers – something more robust that simple input scripts for the built-in FTP.exe app. well, ask no more, just go to http://www.primalscript.com/freetools and download the new FTP COM object. With it, you can connect to FTP sites (providing credentials if needed) and Get and Put files using simple Get() and Put() methods. Quick, easy, and the download includes samples showing how to use it – you can even check for failed connections and transfers using status codes returned by the various methods. Free, free, free. Enjoy.
PS. Works great in VBScript, PowerShell, KiXtart, JScript – any language that supports COM. Included samples are in VBScript.
Great tool!
I’m maybe missing something but shouldn’t Put() return 0 in case of success.
I converted the put vbscript example to PowerShell script file.
$ftp.Put($RemotePath,$localFile) returns 1 (error) and still I can see that the file was uploded successfully.
Shay
http://scriptolog.blogspot.com
Thanks!
Here’s the link to Shay’s PowerShell solution:
http://scriptolog.blogspot.com/2007/09/ftp-transfers-automation.html
Shay, I’m going to upload an updated version sometime today that corrects the response code from Put(). Sorry ’bout that.
Just like to say this works brilliantly. Just what I was looking for. I only have one problem. Is there anyway to delete or move the files off the FTP site when I have finished downloading.
I have tried oftp.Delete and oftp.Move but with little sucess.
Any ideas or am I asking for to much LOL
Right now the component doesn’t offer a Delete command, which is what you’d need – it only offer Put() and Get(). I encourage you to post that Wish in the Wish List Forum at http://www.sapien.com/support.asp.
I am also running into the PUT() problem. Is there somewhere I can get the updated version?
Did you download the tool when it first came out or recently? There is a Free Tools support forum at SAPIEN.com which is where you should post this if you have the latest version and still have the problem.
Just found this COM object today, gonna try it.
But someone already mentioned one thing I will need, and that is the delete option….I can do a work around for him.
Is there any other detailed info on this COM object somewhere?
I want to try it vs. using what I have setup now to download the NAV update for my AV software. For some reason in Windows 2003 Server FTP seems to have issues when doing a FTP get on files…..it is very inconsistent…so it works fine sometimes, but will fail others….I forget what the error is now..
Funny thing is I have never had this issue on a Windows 2K Server box that does the same exact thing.
If you have a "wish" for the component, that’s best posted in the support forums at http://www.sapien.com, which is where the development team hangs out.
Firstly loving the ftp dll, but (you just knew there was going to be a but)
the GET is leaving a copy of the files in the profile of the account that runs the script and when those files are >5GB the c: drive is filling fast,
now for any wise guys who scan read, this is a copy of the file that appears as if by magic but only sometimes, the destination for the files is one with enough space.
I assume this is used as temporary holding space by http://ftp.dll, can I redirect this temporary folder? how does http://ftp.dll determine the location of the temp storage?
wish list
can I have an FTP List/dir, FTP Delete last but not least an
FTP This weeksLotteryNumbers
Thanks
Paul
Please post something in the support forums at SAPIEN.com. It’s next to impossible for the dev team to offer support through blog comments.