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 » Community » Newbie corner » upload / download
upload / download [message #55121] Mon, 12 October 2020 21:02 Go to next message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,
in the documentation section I didn't find how to upload and download files considering desktop programming. Would you have any example using using progress bar? thanks
Re: upload / download [message #55149 is a reply to message #55121] Wed, 14 October 2020 16:40 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,please

how build progressbar here ?

ftpClient ftp;
if (!ftp.connect(<webserverhostname/webserverip>, <ftpusername>, <ftppassword>, true, 10)) {
Exclamation("Connect error!");
return;
}
if (!ftp.Save(<thedestinationpath>, data) {
Exclamation("Save error!");
return;
}
ftp.Close();

thanks
Re: upload / download [message #55151 is a reply to message #55149] Wed, 14 October 2020 18:37 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello BetoValle

The example below shows how to download a file (with a progress bar).
The file is small, so the progress bar will only show up briefly.

#include <CtrlLib/CtrlLib.h>
#include <plugin/ftp/ftp.h>

using namespace Upp;

GUI_APP_MAIN
{
	FtpClient ftp;
	if(ftp.Connect("test.rebex.net", "demo", "password")) {
		Progress pi(nullptr, "Download");
		pi.Create();
		ftp.WhenProgress << [&pi](int done, int total)
		{
			pi.SetText(Format(t_("%1:s of %2:s is transferred"),
				FormatFileSize(done),
				FormatFileSize(total)));
			return pi.SetCanceled(done, total); // Adds a cancel button and cancels the download if the button is clicked...
		};
		RDUMP(ftp.Load("readme.txt"));
	}
}



Best regards,
Oblivion


Re: upload / download [message #55152 is a reply to message #55121] Wed, 14 October 2020 18:56 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
By the way, therer is also a more modern, feature-rich, documented alternative to the default Ftp package for U++ (In the sense that it integrates into U++ better, as it is written in U++).

It also comes with all kinds of examples.

See the "Core" directory for Ftp package: https://github.com/ismail-yilmaz/upp-components/tree/master/ Core/FTP
See the Examples" directory for Ftp examples: https://github.com/ismail-yilmaz/upp-components/tree/master/ Examples

Best regards,
Oblivion


[Updated on: Wed, 14 October 2020 19:00]

Report message to a moderator

Re: upload / download [message #55153 is a reply to message #55152] Wed, 14 October 2020 20:04 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member

How do I import (or install an external component) into the U ++ IDE?
have some step by step for a beginner ?

Thanks

Re: upload / download [message #55155 is a reply to message #55153] Wed, 14 October 2020 21:02 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Quote:
How do I import (or install an external component) into the U ++ IDE?
have some step by step for a beginner ?


Easiest way:

- You can download or clone the repo, then simply move the relevant packages (e.g, Ftp) to upp directories (e.g. pathto/uppsrc or pathto/bazaar, or to MyApps)

Preferred way:
- You can download or clone the repo and add the relevant directories as nests to some assembly you use. It is explained in this article: https://www.ultimatepp.org/app$ide$PackagesAssembliesAndNest s$en-us.html


Best regards,
Oblivion


Re: upload / download [message #55163 is a reply to message #55155] Thu, 15 October 2020 04:30 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Thanks!
Re: upload / download [message #55207 is a reply to message #55163] Sun, 18 October 2020 21:36 Go to previous message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello BetoValle,

Inspring by your previous messages I added to the documentation how to add dependency to the package. For more information please read updated "Getting started with TheIDE" article. The newly added section is "5. Adding dependencies to package". In case of any trouble and opinion please let me know.

Klugier


U++ - one framework to rule them all.
Previous Topic: Shrila Prabhupada Sanskrit Slovary
Next Topic: "simple" connection and operation with database
Goto Forum:
  


Current Time: Fri Mar 29 09:02:05 CET 2024

Total time taken to generate the page: 0.01574 seconds