Jump to content

FTP not uploading


Recommended Posts

I'm just kind of messing around with the FTP functionality in autoit, I did have it working once but the file was empty when it uploaded and now I am not getting any files uploaded what so ever.

#include <FTPEx.au3>
ftpTest("SERVER", "USERNAME", "PASSWORD")

Func ftpTest($server, $username, $password)
Local $open = _FTP_Open('FTP')
Local $session = _FTP_Connect($open, $server, $username, $password)
If $session == 0 Then
MsgBox(0, "Error connecting", "could not connect")
Else
Local $upload = _FTP_FilePut($session, "./test.txt", "./htdocs/")
MsgBox(0, "", "connected!")
EndIf
_FTP_Close($open)
If $upload == 1 Then
MsgBox(0, "FTP", "File Uploaded!")
ElseIf $upload == 0 Then
MsgBox(0, "Error", @ERROR)
EndIf
EndFunc

It's not an error connecting to the server, its an error with the _FTP_FilePut function and the error I am getting is "0" so its not a very descriptive error...

Link to comment
Share on other sites

  • 2 weeks later...

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

×
×
  • Create New...