Jump to content

Recommended Posts

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

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.

Link to post
Share on other sites

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, "")
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...