thejtr Posted May 4, 2015 Posted May 4, 2015 (edited) Hey autoIT community!I am having a bit of trouble, I am trying to communicate with my FTP server to upload a file, I have tried this script, but it won't work: #include <FTPEx.au3>Func FTP() $server = 'ftp.myftphost.com' $username = 'MyFtpUsername' $pass = 'MyFtpPassword' $Open = _FTP_Open('MyFTP Control') $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _FTP_FilePut($Conn, 'C:\Users\MyUserName\Desktop\test.au3', '/htdocs') $Ftpc = _FTP_Close($Open) ExitEndFunc I don't understand why it won't work, all of the ftp credentials are correct...If someone could help me it would be real nice.Thanks Edited May 4, 2015 by thejtr
Kidney Posted May 4, 2015 Posted May 4, 2015 have you tried using _FTP_DirGetCurrent() to see if you have successfully made a connection and you can read the FTP file directory??
kaisies Posted May 4, 2015 Posted May 4, 2015 (edited) Hey autoIT community!I am having a bit of trouble, I am trying to communicate with my FTP server to upload a file, I have tried this script, but it won't work: #include <FTPEx.au3>Func FTP() $server = 'ftp.myftphost.com' $username = 'MyFtpUsername' $pass = 'MyFtpPassword' $Open = _FTP_Open('MyFTP Control') $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _FTP_FilePut($Conn, 'C:\Users\MyUserName\Desktop\test.au3', '/htdocs') $Ftpc = _FTP_Close($Open) ExitEndFunc I don't understand why it won't work, all of the ftp credentials are correct...If someone could help me it would be real nice.Thanks All of your code is in the ftp function.... Do you ever actually call that function? Edited May 4, 2015 by kaisies
thejtr Posted May 4, 2015 Author Posted May 4, 2015 Never mind, I found out why it did not work, I had to put #RequireAdminbefore it because Windows Firewall was blocking the ftp...
ViciousXUSMC Posted May 4, 2015 Posted May 4, 2015 The @Error is very good on that UDF to help find the problem. It looks like you found it without but had you put error checking in you could have seen your error started right at the connection phase.As for your firewall, is this something only admins will run so you can use #RequireAdmin or will non admin accounts need to run it? You may want to add the proper firewall exceptions if that is the case. An example of my FTP exception that is run when I install the FTP script.Run(@WindowsDir & "\sysnative\cmd.exe /c netsh firewall set allowedprogram program = " & '"C:\Tiburon\MapFTP\Download Map Update.exe"' & " name = MapDownload mode = enable profile = all")
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now