|
|
Home » Community » Newbie corner » upload / download
upload / download [message #55121] |
Mon, 12 October 2020 21:02  |
BetoValle
Messages: 204 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 #55151 is a reply to message #55149] |
Wed, 14 October 2020 18:37   |
Oblivion
Messages: 1206 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
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
|
|
|
|
|
|
|
Re: upload / download [message #55207 is a reply to message #55163] |
Sun, 18 October 2020 21:36  |
 |
Klugier
Messages: 1099 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.
|
|
|
Goto Forum:
Current Time: Sun May 11 01:50:49 CEST 2025
Total time taken to generate the page: 0.01143 seconds
|
|
|