Jump to content
Sign in to follow this  
Unc3nZureD

FTP problems?

Recommended Posts

Unc3nZureD

I tried to make a little FTP script but I failed at _FTP_FileGet() :S

What is the proper use of this command? What did i wrong?

My code:

#Include <FTPEx.au3>

$Open = _FTP_Open('TheDuelRPG')
$Connect = _FTP_Connect($Open, "theduelrpg.clanteam.com", "theduelrpg_clanteam", "Publicpassword")

$FileGet = _FTP_FileGet($Connect, "index.html", @ScriptDir & "\index.html")

$Close = _FTP_Close($Open)

msgbox(0,"","DONE" & @CRLF & " " & @CRLF & $Open & @CRLF & $Connect & @CRLF & $FileGet & @CRLF & $Close)

FileGet = 0

Others: Successful

Please help me.

Edited by Unc3nZureD

Share this post


Link to post
Share on other sites
Tripredacus

You are sure that index.html is in the default dir once you log in? Some FTPs will put you in a root where you need to CD into the main account dir.

Share this post


Link to post
Share on other sites
GMK

Your script works fine for me. You might also check your firewalls to make sure it's not blocking the FTP processes.

Share this post


Link to post
Share on other sites
Unc3nZureD

Your script works fine for me. You might also check your firewalls to make sure it's not blocking the FTP processes.

is that possible that my firewall blocks autoit but it doesn't block FileZilla? Because it works for me too in filezilla.

Share this post


Link to post
Share on other sites
smartee

Your script worked fine for me too, :)

Try this version, post your Debug.log if it doesn't work ;)

#include <FTPEx.au3>
#include <Date.au3>
$sPath = @ScriptDir & "\Debug.log"
FileWriteLine($sPath, "Session Start: " & _NowCalc())
$Open = _FTP_Open('TheDuelRPG')
FileWriteLine($sPath, "_FTP_Open returned " & $Open & " @error:" & @error)
$Connect = _FTP_Connect($Open, "theduelrpg.clanteam.com", "theduelrpg_clanteam", "Publicpassword")
FileWriteLine($sPath, "_FTP_Connect returned " & $Connect & " @error:" & @error)
$Exists = FileExists(@ScriptDir & "\index.html")
FileWriteLine($sPath, "FileExists returned " & $Exists & " @error:" & @error)
If $Exists Then
    $Deleted = FileDelete(@ScriptDir & "\index.html")
    FileWriteLine($sPath, "FileDelete returned " & $Deleted & " @error:" & @error)
EndIf
$FileGet = _FTP_FileGet($Connect, "index.html", @ScriptDir & "\index.html")
FileWriteLine($sPath, "_FTP_FileGet returned " & $FileGet & " @error:" & @error)
$Close = _FTP_Close($Open)
FileWriteLine($sPath, "_FTP_Close returned " & $Close & " @error:" & @error)
FileWriteLine($sPath, "Session End: " & _NowCalc())
FileWriteLine($sPath, "")

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.