We need to develop an SFTP client as part of a sales order processing system. When I first found PureBasic last year, the first thing I noticed was that it already provides FTP, straight out of the box. Within about 30 minutes, I had written an ftp transfer routine . Due to the fact that this new requirement is for an invoice data transfer, it falls to me to provide (or develop) an SFTP solution. Is this possible to do in PB?
I have seen something on a website called Chilkat with examples of PB code and I'm not sure if others are aware of this.
Last edited by Oso on Mon Jan 30, 2023 7:37 pm, edited 1 time in total.
swhite wrote: Wed Jan 25, 2023 8:16 pm
I use Chillkat often and it works well with PB. So it should be fairly simple to create an SFTP app with PB and Chillkat. Simon
Thanks for the reply, Simon. Do they provide all those modules shown on their website as a single package? It wasn't entirely clear to me how to choose the required module.
before your IncludeFile.
And copy the corresponding dll to your file directory.
(I always set the option 'create temporary executable in the sourcecode directory' in compiler options)
infratec wrote: Wed Jan 25, 2023 11:29 pm
It is possible with libcurl. For this you need an external libcurl.dll (or compile your own static lib) which includes sftp. And my libcurl.pbi.
My libcurl.pbi is here: viewtopic.php?t=80118 In the libcurl.dll, which is in my zip file, sftp is included.
This is great Infratec, thanks very much indeed. The two links that you included for the C code at curl.se/libcurl/c... — I assume this is just for reference? In the C code is #include <curl/curl.h> so I'm guessing your libcurl.pbi is an equivalent of that C header file. Am I understanding it correctly?
Thanks Infratec, I've just been looking at it the SFTP. The rebex.net ftp test is useful, that saves the need to set up an sftp server on another machine.
Incidentally, where is the function that determines whether we are using 'get' or 'put'? I looked at your two ftps examples earlier and I see that one is sending, the other receiving, but I couldn't see where it sets that mode.
swhite wrote: Wed Jan 25, 2023 8:16 pm
I use Chillkat often and it works well with PB. So it should be fairly simple to create an SFTP app with PB and Chillkat. Simon
Thanks for the reply, Simon. Do they provide all those modules shown on their website as a single package? It wasn't entirely clear to me how to choose the required module.
They work very well indeed Thank you for adding these Infratec. I tested using a 13MB file which was transferred perfectly. I will continue tomorrow, as it's late here now. I looked at 'resume' and I see that it has the capability to send from the last point onwards. Thanks again for doing this. I will think about it further and have some more ideas.