Seite 2 von 2

Re: SendFTPFileEx

Verfasst: 05.03.2026 22:12
von PIC18F2550
Ich hab alle auskommentierten Zeilen entfernt.
Der Fehler ist der zweite Aufruf von "OpenFTPEx" warscheinlich kann "CloseFTPEx" durch den Fehler nicht richtig geschlossen werden.

Code: Alles auswählen

Global PBEx_FTP

#PBEx_FTP_Version$ = "1.0.6.0"
#PBEx_FTP_Protocol_FTP = 1
#PBEx_FTP_Protocol_SFTP = 2
#PBEx_FTP_Protocol_FTPS_Implicit = 3
#PBEx_FTP_Protocol_FTPS_Explicit = 4

CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
  PBEx_FTP = OpenLibrary(#PB_Any, "PB.Ex_FTP_x86.dll")
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
  PBEx_FTP = OpenLibrary(#PB_Any, "PB.Ex_FTP_x64.dll")
CompilerEndIf
If PBEx_FTP
  Prototype OpenFTPEx(ID, Protocol, ServerName.p-Unicode, Port, User.p-Unicode, Password.p-Unicode, Charset, ErrorOutput)
  Global OpenFTPEx.OpenFTPEx = GetFunction(PBEx_FTP, "OpenFTPEx")
  Prototype CloseFTPEx(ID, ErrorOutput)
  Global CloseFTPEx.CloseFTPEx = GetFunction(PBEx_FTP, "CloseFTPEx")
  Prototype CheckFTPConnectionEx(ID, ErrorOutput)
  Global CheckFTPConnectionEx.CheckFTPConnectionEx = GetFunction(PBEx_FTP, "CheckFTPConnectionEx")
  Prototype IsFTPEx(ID, ErrorOutput)
  Global IsFTPEx.IsFTPEx = GetFunction(PBEx_FTP, "IsFTPEx")
  Prototype ExamineFTPDirectoryEx(ID, ErrorOutput)
  Global ExamineFTPDirectoryEx.ExamineFTPDirectoryEx = GetFunction(PBEx_FTP, "ExamineFTPDirectoryEx")
  Prototype FinishFTPDirectoryEx(ID, ErrorOutput)
  Global FinishFTPDirectoryEx.FinishFTPDirectoryEx = GetFunction(PBEx_FTP, "FinishFTPDirectoryEx")
  Prototype NextFTPDirectoryEntryEx(ID, ErrorOutput)
  Global NextFTPDirectoryEntryEx.NextFTPDirectoryEntryEx = GetFunction(PBEx_FTP, "NextFTPDirectoryEntryEx")
  Prototype FTPDirectoryEntryNameEx(ID, Output, ErrorOutput)
  Global FTPDirectoryEntryNameEx.FTPDirectoryEntryNameEx = GetFunction(PBEx_FTP, "FTPDirectoryEntryNameEx")
  Prototype.q FTPDirectoryEntrySizeEx(ID, ErrorOutput)
  Global FTPDirectoryEntrySizeEx.FTPDirectoryEntrySizeEx = GetFunction(PBEx_FTP, "FTPDirectoryEntrySizeEx")
  Prototype FTPDirectoryEntryTypeEx(ID, ErrorOutput)
  Global FTPDirectoryEntryTypeEx.FTPDirectoryEntryTypeEx = GetFunction(PBEx_FTP, "FTPDirectoryEntryTypeEx")
  Prototype FTPDirectoryEntryDateEx(ID, ErrorOutput)
  Global FTPDirectoryEntryDateEx.FTPDirectoryEntryDateEx = GetFunction(PBEx_FTP, "FTPDirectoryEntryDateEx")
  Prototype FTPDirectoryEntryAttributesEx(ID, ErrorOutput)
  Global FTPDirectoryEntryAttributesEx.FTPDirectoryEntryAttributesEx = GetFunction(PBEx_FTP, "FTPDirectoryEntryAttributesEx")
  Prototype GetFTPDirectoryEx(ID, Output, ErrorOutput)
  Global GetFTPDirectoryEx.GetFTPDirectoryEx = GetFunction(PBEx_FTP, "GetFTPDirectoryEx")
  Prototype SetFTPDirectoryEx(ID, DirectoryName.p-Unicode, ErrorOutput)
  Global SetFTPDirectoryEx.SetFTPDirectoryEx = GetFunction(PBEx_FTP, "SetFTPDirectoryEx")
  Prototype CreateFTPDirectoryEx(ID, DirectoryName.p-Unicode, ErrorOutput)
  Global CreateFTPDirectoryEx.CreateFTPDirectoryEx = GetFunction(PBEx_FTP, "CreateFTPDirectoryEx")
  Prototype DeleteFTPDirectoryEx(ID, DirectoryName.p-Unicode, ErrorOutput)
  Global DeleteFTPDirectoryEx.DeleteFTPDirectoryEx = GetFunction(PBEx_FTP, "DeleteFTPDirectoryEx")
  Prototype DeleteFTPFileEx(ID, FileName.p-Unicode, ErrorOutput)
  Global DeleteFTPFileEx.DeleteFTPFileEx = GetFunction(PBEx_FTP, "DeleteFTPFileEx")
  Prototype RenameFTPFileEx(ID, FileName.p-Unicode, NewFileName.p-Unicode, ErrorOutput)
  Global RenameFTPFileEx.RenameFTPFileEx = GetFunction(PBEx_FTP, "RenameFTPFileEx")
  Prototype ReceiveFTPFileEx(ID, RemoteFileName.p-Unicode, FileName.p-Unicode, IsAsynchron,  ErrorOutput)
  Global ReceiveFTPFileEx.ReceiveFTPFileEx = GetFunction(PBEx_FTP, "ReceiveFTPFileEx")
  Prototype SendFTPFileEx(ID, FileName.p-Unicode, RemoteFileName.p-Unicode, IsAsynchron, ErrorOutput)
  Global SendFTPFileEx.SendFTPFileEx = GetFunction(PBEx_FTP, "SendFTPFileEx")  
  Prototype FTPProgressEx(ID, PercentValue, TransferRate, EstimatedTime, ErrorOutput)
  Global FTPProgressEx.FTPProgressEx = GetFunction(PBEx_FTP, "FTPProgressEx")
  Prototype AbortFTPFileEx(ID, ErrorOutput)
  Global AbortFTPFileEx.AbortFTPFileEx = GetFunction(PBEx_FTP, "AbortFTPFileEx")  
EndIf
Define ErrorOutput$ = Space(128)
Define FileName$ = Space(#MAX_PATH)
Define Status
Repeat
  If OpenFTPEx(2, #PBEx_FTP_Protocol_FTPS_Explicit, "pic18f2550.lima-ftp.de", 21, "pic18f2550", "8wDzq7UZis", #PB_UTF8, @ErrorOutput$) ; wird in PB rot Markiert
    If SetFTPDirectoryEx(2, "default-websitexxxxxx", @ErrorOutput)   ; Fehlertest falscher Pfadname
    EndIf 
    CloseFTPEx(2, @ErrorOutput$)
  EndIf 
  Delay (10001 )  
Until Status=222
End
Was wird noch gebraucht?

Re: SendFTPFileEx

Verfasst: 05.03.2026 22:16
von mk-soft
HeX0R hat geschrieben: 05.03.2026 17:33 mit EnableExplicit wäre das vermutlich nicht passiert
Jetzt habe ich es auch gesehen :roll:

Re: SendFTPFileEx

Verfasst: 05.03.2026 22:31
von PIC18F2550
:cry: Ich hätte richtig sehen sollen Im Gesamtprojekt habe ich es drinn aber im herauskopierten Teil nicht.

Nach 10 h sollte ich nicht mehr am schlepptop sitzen.

Der Fehler war dann schnell gefunden.

If SetFTPDirectoryEx(2, "default-websitexxxxx", @ErrorOutput$) ES FEHLTE DAS $.

Danke.

Re: SendFTPFileEx

Verfasst: 06.03.2026 00:34
von HeX0R
Bingo! :allright:
Tatsächlich finde ich diesen Thread mittlerweile sehr amüsant.
Hättest Du von Anfang an Code gepostet, mit dem wir was anfangen können, hätte ich gar nicht so vage geantwortet.
z.B. konnte ja keiner wissen, ob nicht irgendwo in Deinem (uns unbekanntem) Code ein
Define ErrorOutput.s = Space(128)
steht.
Dann wäre meine Vermutung natürlich hinfällig gewesen.

Amüsant finde ich es, weil meine Antwort durch mehrere Blumen selbst mk-soft verwirrt hat.
Das war natürlich nicht das Ziel, ich wollte viel eher Dir eine Lektion erteilen, weil tatsächlich NIEMAND den Fehler sicher sehen konnte.
Weil eben zuviele Informationen gefehlt hatten.

Na ja, Du hast eine weitere Frage damit freigespielt, eigentlich wollte ich Dich schon auf die Ignore-Ersatzbank setzen :mrgreen:

Re: SendFTPFileEx

Verfasst: 06.03.2026 20:00
von mk-soft
Auch wenn es mehr Aufwand ist, verwende IMMER EnableExplicit