Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
Oblivion is currently offline  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,
Disconnect();


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


[Updated on: Sun, 04 August 2024 11:46]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HttpRequest::GetPath() [FEATURE REQUEST]
Next Topic: HTTPREQUEST using Proxy not working -- SOLVED
Goto Forum:
  


Current Time: Tue Aug 12 09:57:18 CEST 2025

Total time taken to generate the page: 0.06867 seconds