Click here to Skip to main content
Licence 
First Posted 3 Mar 2000
Views 163,695
Bookmarked 83 times

CHttpDownloadDlg v1.03

By | 3 Mar 2000 | Article
A dialog implementation that performs HTTP downloads.
  • Download source files - 42 Kb
  • Sample Image - DownloadDlg.gif

    Introduction

    Welcome to CHttpDownloadDlg, an MFC dialog which performs HTTP downloads similar to the Internet Explorer download dialog as shown above.


    History
    Usage
    Contacting the Author


    History

    V1.0 (14 November 1999)
    • First public release.

    V1.01 (15 November 1999)

    • Updated documentation to refer to what rc resources are needed by the class.
    • Renamed all resources used from ASYNC_DOWLOAD to include HTTPDOWNLOAD.
    • Now handles HTTP error 407 (Proxy Authentication) and HTTP error 401 (Server Authentication). You are prompted with a password dialog when either of these forms of authentication are required.
    • Sample program now allows you to specify the URL to download from as well as the file to download into and the username and password to connect with.
    • The download file is now deleted if the download was aborted or if some other error occurs during the download.
    • Parsing of URL will now work where "http://" is not explicitely specified.
    • Improved the general look and feel of the demo app and called it "HTML File Downloader".

    V1.02 (29 November 1999)

    • Fixed a number of compiler warnings and errors when used in VC++ 6.0.

    V1.03 (25 January 2000)

    • Fixed a problem where server authentication was not being detected correctly, while proxy authentication was being handled.
    • Updated the way and periodicity certain UI controls are updated during the HTTP download.


    Usage

    To use CHttpDownloadDlg in your project simply include HttpDownloadDlg.cpp/.h from the test application in your application and #include "HttpDownloadDlg.h" in whichever files you want to use the class in. To bring up the dialog to download a specific file, just use some code like the following:

    CHttpDownloadDlg dlg;
    dlg.m_sURLToDownload = _T("http://www.some-site.com/somefile.ext");
    dlg.m_sFileToDownloadInto = _T("c:\\somfile.ext");
    if (dlg.DoModal() == IDOK)
       AfxMessageBox("File was downloaded successfully");
    

    You should also have a look at the CInetDownloadDlg::OnDownload() code in the sample application.


    Contacting the Author

    PJ Naughter
    Email: pjn@indigo..ie
    Web: http://www.naughter.com
    25 January 2000


    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    PJ Naughter



    United States United States

    Member



    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralMy vote of 4 Pinmemberminsikchu15:02 8 Sep '10  
    QuestionHow to copy the res? Pinmemberrootdial8:42 5 Apr '06  
    Hi, i would like to use this class, but i can find no way
    to copy the resource to my project. I am on Visual Studio 2003
    and did try to copy via drag and drop. But it ends up in..nothing.
    I just get "string table" active. But no dialog was dropped.
     
    Like u said: nothing magic. But not if you are new to programming Smile | :)
    I hope you can help me out.
     
    Tanks!!Big Grin | :-D
    Generaltoo many errors Pinmemberpetri1117:17 23 Oct '04  
    GeneralRe: too many errors Pinmemberpjnaughter10:50 23 Oct '04  
    GeneralRe: too many errors Pinmemberpetri11118:22 28 Oct '04  
    GeneralRe: too many errors Pinmemberpjnaughter1:06 29 Oct '04  
    GeneralRe: too many errors PinmemberKarstenK23:11 13 Jul '05  
    GeneralRe: too many errors Pinmemberpjnaughter0:12 14 Jul '05  
    QuestionHow to upload a file to a HTTP server? PinmemberMaTrIX2k212:32 16 May '04  
    AnswerRe: How to upload a file to a HTTP server? Pinmemberpjnaughter0:14 17 May '04  
    Question102 error(s), 5 warning(s) What's wrong?? PinmemberLocura66616:26 8 Mar '04  
    AnswerRe: 102 error(s), 5 warning(s) What's wrong?? Pinmemberpjnaughter0:18 17 May '04  
    QuestionHow to ignore global offline mode? PinmemberRalfy17:25 3 Mar '04  
    GeneralLots and Lots of Errors when compiling Pinmembershultas17:04 11 Feb '04  
    GeneralRe: Lots and Lots of Errors when compiling Pinmemberpjnaughter21:30 11 Feb '04  
    GeneralRe: Lots and Lots of Errors when compiling Pinmembershultas5:46 12 Feb '04  
    GeneralRe: Lots and Lots of Errors when compiling Pinmemberpjnaughter6:01 12 Feb '04  
    GeneralCompile shouts: unresolved symbols PinmemberHintiFlo10:27 22 Jan '04  
    GeneralRe: Compile shouts: unresolved symbols Pinmemberpjnaughter11:36 22 Jan '04  
    GeneralRe: Compile shouts: unresolved symbols PinmemberHintiFlo22:24 22 Jan '04  
    GeneralRe: Compile shouts: unresolved symbols PinmemberHintiFlo2:24 23 Jan '04  
    GeneralATL downloading PinmemberBalkrishna Talele19:16 6 Jan '04  
    GeneralRe: ATL downloading Pinmemberpjnaughter2:46 7 Jan '04  
    GeneralBinary downloads PinmemberChris Losinger16:59 14 Dec '03  
    GeneralRe: Binary downloads Pinmemberpjnaughter22:49 14 Dec '03  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web02 | 2.5.120529.1 | Last Updated 4 Mar 2000
    Article Copyright 2000 by PJ Naughter
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid