Jump to content

Recommended Posts

Posted (edited)

I have used this code for a long time, but for a week or 2 it stopped working?
Connection is ok, the put create the file on server if I delete it on the FTP server, but the file is empty and after 30 secondees the function return 0
I have tested on 2 machines, Filezilla FTP client have no issue to the server.
Firewall is disabled under test.

  If $writeFTP = True Then
      $Open=_FTPOpen('MyFTP Control')
      $Conn=_FTPConnect($Open, $destinationServer, $destinationUsername, $destinationPass)
 MsgBox(0,"start","start")
      $Ftpp=_FtpPutFile($Conn, $filePath&$name&".json", "httpdocs/p_calender/" & $name & ".json")
MsgBox(0,"return","return"&$Ftpp)
Exit
      $Ftpc=_FTPClose($Open)
     EndIf

 

From the Lib:

Func _FTPPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0)

    Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'FtpPutFile', 'long', $l_FTPSession, 'str', $s_LocalFile, 'str', $s_RemoteFile, 'long', $l_Flags, 'long', $l_Context)
    If @error OR $ai_FTPPutFile[0] = 0 Then
        SetError(-1)
        Return 0
    EndIf

    Return $ai_FTPPutFile[0]

EndFunc ;==> _FTPPutFile()

 

Edited by Sigmac
Posted

Please read this:
How to post code on the forum *

And edit your post.

btw.
Try to use:
 

_FTP_GetLastResponseInfo()

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I have tryed _FTP_GetLastResponseInfo( ) but can't get it to work
The only response I get is 1
ByRef $iError <-- what var should I use here?
ByRef $sMessage <-- what var should I use here?

I have try to change to the FTP lib you refer to but same issue

 

Posted
Local  $iError,  $sMessage 
_FTP_GetLastResponseInfo ( $iError, $sMessage )

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Ohh so the vars is output not input!
The return is:
"0
200 Type set to 1
200 Port command successful"
Result is still the same file is created but no date transferred.

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
×
×
  • Create New...