Download with progressbar lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- lazzaro2023 · 2023-02-07 17:56 Hi everyone!!! I have a problem. Is it possible to implement a procedure that shows me a progress bar while I download a file from the internet? Can someone help me? ---------------------------------------------------------------------- Handoko · 2023-02-07 18:23 Hello lazzaro2023, Welcome to the forum. In the link below, you can find "File download" demo in the Networking category: https://wiki.freepascal.org/Portal:HowTo_Demos ---------------------------------------------------------------------- dje · 2023-02-07 18:43 I posted a threaded progressbar downloader here: https://forum.lazarus.freepascal.org/index.php/topic,60314.msg450770.h tml#msg450770 The actual downloading code is maybe ~150 lines. I couldn't think of a smaller way of writing one. I've also attached a project to this post. It should get you started ---------------------------------------------------------------------- lazzaro2023 · 2023-02-09 09:19 Thanks for the posts!! I need to do the same thing for uploading files. Can you help me? ---------------------------------------------------------------------- KodeZwerg · 2023-02-09 10:09 Quote from: lazzaro2023 on February 09, 2023, 10:19:25 amCan you help me?We can try. Quote from: lazzaro2023 on February 09, 2023, 10:19:25 amI need to do the same thing for uploading files.Upload to where? Basics are the same, just easier since a download with a progressbar can be wrong when the source not tell the real size (for such my download switch to a marquee and still tells in how fast it is) So have your progressbar updated after each chunk you uploaded. ---------------------------------------------------------------------- lazzaro2023 · 2023-02-09 11:02 Quote from: KodeZwerg on February 09, 2023, 11:09:49 amUpload to where? Internet Quote from: KodeZwerg on February 09, 2023, 11:09:49 amBasics are the same, just easier since a download with a progressbar can be wrong when the source not tell the real size (for such my download switch to a marquee and still tells in how fast it is) So have your progressbar updated after each chunk you uploaded. You have an example? ---------------------------------------------------------------------- KodeZwerg · 2023-02-09 11:12 Quote from: lazzaro2023 on February 09, 2023, 12:02:44 pmYou have an example?I just did a quick search on this forum, here is my first hit: https://forum.lazarus.freepascal.org/index.php/topic,14889.msg79354.ht ml#msg79354 ---------------------------------------------------------------------- KodeZwerg · 2023-02-09 11:16 Quote from: lazzaro2023 on February 09, 2023, 12:02:44 pmQuote from: KodeZwerg on February 09, 2023, 11:09:49 amUpload to where?InternetSince "Internet" is no protocol but for transfers you need a protocol your answer is just ..... So what I showed you in my last post is for the FTP (File Transfer Protocol) If that is not what you need, be more specific. ---------------------------------------------------------------------- lazzaro2023 · 2023-02-09 12:20 Quote from: KodeZwerg on February 09, 2023, 12:16:19 pmSince "Internet" is no protocol but for transfers you need a protocol your answer is just ..... So what I showed you in my last post is for the FTP (File Transfer Protocol) If that is not what you need, be more specific. I apologize!!! The protocol is http. ---------------------------------------------------------------------- balazsszekely · 2023-02-09 12:23 Quote from: lazzaro2023 on February 09, 2023, 01:20:41 pmQuote from: KodeZwerg on February 09, 2023, 12:16:19 pmSince "Internet" is no protocol but for transfers you need a protocol your answer is just ..... So what I showed you in my last post is for the FTP (File Transfer Protocol) If that is not what you need, be more specific. I apologize!!! The protocol is http. Here you go: https://forum.lazarus.freepascal.org/index.php/topic,44795.0.html ---------------------------------------------------------------------- lazzaro2023 · 2023-02-09 16:15 Quote from: GetMem on February 09, 2023, 01:23:17 pmHere you go: https://forum.lazarus.freepascal.org/index.php/topic,44795.0.html Ok! Thanks! But there is no possibility to monitor with a progressbar the upload of the file ... ---------------------------------------------------------------------- balazsszekely · 2023-02-09 16:56 Quote from: lazzaro2023 on February 09, 2023, 05:15:48 pmQuote from: GetMem on February 09, 2023, 01:23:17 pmHere you go: https://forum.lazarus.freepascal.org/index.php/topic,44795.0.html Ok! Thanks! But there is no possibility to monitor with a progressbar the upload of the file ... Did you download the attachment from Reply #2? I see a big juicy progressbar on the main form. ---------------------------------------------------------------------- lazzaro2023 · 2023-02-26 14:22 Thank you for the report. I saw the progress bar in the foreground, but it indicates the bytes read from the read stream buffer, not the bytes actually uploaded to the server. Do you have a solution for this on the client-side program?