Home » U++ Library support » U++ MT-multithreading and servers » FtpClient heap leak
Re: FtpClient heap leak [message #60726 is a reply to message #60725] |
Sun, 04 August 2024 11:42   |
Oblivion
Messages: 1223 Registered: August 2007
|
Senior Contributor |
|
|
Hello Luigi,
Quote:1. after connect, how to enter in a given folder? I had ftp.Cd(folder)
bool Ftp::SetDir(const String& path)
Quote:
2. How can I transfer a file named myfile.txt and content hold in the String ff? I used
Data transfer methods:
String Get(const String& path, bool ascii = false);
bool Get(const String& path, Stream& s, bool ascii = false);
bool Put(Stream& s, const String& path, bool ascii = false);
bool Put(const String& s, const String& path, bool ascii = false);
bool Append(Stream &s, const String& path, bool ascii = false);
bool Append(const String& s, const String& path, bool ascii = false);
Quote: 3. How to close the connection?
You can use,
Note that Disconnect() method is also called in the destructor, if it is not explicity called.
Basic data transfer example:
#include <Core/Core.h>
#include <FTP/Ftp.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
// Ftp::Trace();
Ftp ftpclient;
if(ftpclient.Timeout(60000).Connect("ftp://demo:password@test.rebex.net:21")) {
auto f = ftpclient.Get("readme.txt", true);
if(!ftpclient.IsError()) {
RLOG(f);
return;
}
}
RLOG(ftpclient.GetErrorDesc());
}
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sun, 04 August 2024 11:46] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Aug 12 13:05:16 CEST 2025
Total time taken to generate the page: 0.06325 seconds
|