Page 1 of 1

Question about PB's built-in FTP

Posted: Tue Mar 12, 2024 1:43 pm
by dige
Hi guys, what are your experiences with the internal FTP functions?

For a project I need a file transfer for the first time and have to connect to an intranet Microsoft IIS FTP server.

I can connect anonymously and do not need any special requirements. With a file manager such as Total Commander or Double Commander, I can easily connect as an anonymous user and upload files.

With PB FTP I can connect and (presumably) select the target directory. But SendFTPFile() simply fails.

So I wonder if I should invest more time in this or if there are already known limitations in the FTP implementation?

Fortunately I found PB.Ex_FTP. It worked right away. But I would like to avoid external dependencies.


What do you think?


This is my code:

Code: Select all


Procedure FTP_Transfer()
  Protected Result
  
  If OpenFTP(0, "192.168.150.126", "anonymous", "anonymous@anonymous.org", #False, 21)
    
    If SetFTPDirectory(0, "ps")
      Debug "Directory set to /ps"
    EndIf
    
    Debug IsFTP(0)
    
    
    Result = SendFTPFile(0, OpenFileRequester("Choose a file to send", "", "*.*", 0), "purebasic_sent.pb")
    Debug "Result: " + Str(Result)
    
  EndIf  
  
EndProcedure

FTP_Transfer()

MessageRequester( "FTP done", "")

End


Re: Question about PB's built-in FTP

Posted: Tue Mar 12, 2024 5:10 pm
by Fred
The built-in FTP is old and doesn't work everywhere, I plan to change it somewhen to use libcurl instead.

Re: Question about PB's built-in FTP

Posted: Tue Mar 12, 2024 10:21 pm
by HeX0R
How many Bucks would be needed to get from "somewhen" to "soon"? :mrgreen:

Re: Question about PB's built-in FTP

Posted: Wed Mar 13, 2024 12:05 am
by Quin
I am interested as well, would gladly help fund a better FTP lib :)
HeX0R wrote: Tue Mar 12, 2024 10:21 pm How many Bucks would be needed to get from "somewhen" to "soon"? :mrgreen:

Re: Question about PB's built-in FTP

Posted: Wed Mar 13, 2024 3:39 am
by BarryG
dige wrote: Tue Mar 12, 2024 1:43 pmwhat are your experiences with the internal FTP functions?
Works great for me. SendFTPFile() works as expected when I upload files to my website.

Re: Question about PB's built-in FTP

Posted: Wed Mar 13, 2024 6:14 pm
by hoerbie
I'm also willing to fund a "soon" update, when it enables to use FTPS or SFTP from PB.