Click here to Skip to main content
11,490,003 members (56,039 online)
Click here to Skip to main content

CHttpDownloadDlg v1.03

, 3 Mar 2000 184.6K 5.5K 96
Rate this:
Please Sign up or sign in to vote.
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

    Share

    About the Author

    PJ Naughter

    United States United States
    No Biography provided

    Comments and Discussions

     
    GeneralMy vote of 4 Pin
    minsikchu8-Sep-10 16:02
    memberminsikchu8-Sep-10 16:02 
    QuestionHow to copy the res? Pin
    rootdial5-Apr-06 9:42
    memberrootdial5-Apr-06 9:42 
    Generaltoo many errors Pin
    petri11123-Oct-04 8:17
    memberpetri11123-Oct-04 8:17 
    GeneralRe: too many errors Pin
    pjnaughter23-Oct-04 11:50
    memberpjnaughter23-Oct-04 11:50 
    GeneralRe: too many errors Pin
    petri11128-Oct-04 19:22
    memberpetri11128-Oct-04 19:22 
    GeneralRe: too many errors Pin
    pjnaughter29-Oct-04 2:06
    memberpjnaughter29-Oct-04 2:06 
    GeneralRe: too many errors Pin
    KarstenK14-Jul-05 0:11
    memberKarstenK14-Jul-05 0:11 
    GeneralRe: too many errors Pin
    pjnaughter14-Jul-05 1:12
    memberpjnaughter14-Jul-05 1:12 
    QuestionHow to upload a file to a HTTP server? Pin
    MaTrIX2k216-May-04 13:32
    memberMaTrIX2k216-May-04 13:32 
    AnswerRe: How to upload a file to a HTTP server? Pin
    pjnaughter17-May-04 1:14
    memberpjnaughter17-May-04 1:14 
    Question102 error(s), 5 warning(s) What's wrong?? Pin
    Locura6668-Mar-04 17:26
    memberLocura6668-Mar-04 17:26 
    AnswerRe: 102 error(s), 5 warning(s) What's wrong?? Pin
    pjnaughter17-May-04 1:18
    memberpjnaughter17-May-04 1:18 
    QuestionHow to ignore global offline mode? Pin
    Ralfy3-Mar-04 18:25
    memberRalfy3-Mar-04 18:25 
    GeneralLots and Lots of Errors when compiling Pin
    shultas11-Feb-04 18:04
    membershultas11-Feb-04 18:04 
    GeneralRe: Lots and Lots of Errors when compiling Pin
    pjnaughter11-Feb-04 22:30
    memberpjnaughter11-Feb-04 22:30 
    GeneralRe: Lots and Lots of Errors when compiling Pin
    shultas12-Feb-04 6:46
    membershultas12-Feb-04 6:46 
    GeneralRe: Lots and Lots of Errors when compiling Pin
    pjnaughter12-Feb-04 7:01
    memberpjnaughter12-Feb-04 7:01 
    GeneralCompile shouts: unresolved symbols Pin
    HintiFlo22-Jan-04 11:27
    memberHintiFlo22-Jan-04 11:27 
    GeneralRe: Compile shouts: unresolved symbols Pin
    pjnaughter22-Jan-04 12:36
    memberpjnaughter22-Jan-04 12:36 
    GeneralRe: Compile shouts: unresolved symbols Pin
    HintiFlo22-Jan-04 23:24
    memberHintiFlo22-Jan-04 23:24 
    GeneralRe: Compile shouts: unresolved symbols Pin
    HintiFlo23-Jan-04 3:24
    memberHintiFlo23-Jan-04 3:24 
    GeneralATL downloading Pin
    Balkrishna Talele6-Jan-04 20:16
    memberBalkrishna Talele6-Jan-04 20:16 
    GeneralRe: ATL downloading Pin
    pjnaughter7-Jan-04 3:46
    memberpjnaughter7-Jan-04 3:46 
    GeneralBinary downloads Pin
    Chris Losinger14-Dec-03 17:59
    memberChris Losinger14-Dec-03 17:59 
    GeneralRe: Binary downloads Pin
    pjnaughter14-Dec-03 23:49
    memberpjnaughter14-Dec-03 23:49 
    GeneralWhen download is cancelled the dialog still shows Aborting and dose'nt abort Pin
    Vikrant Vikrant24-Sep-03 5:44
    memberVikrant Vikrant24-Sep-03 5:44 
    GeneralRe: When download is cancelled the dialog still shows Aborting and dose'nt abort Pin
    pjnaughter24-Sep-03 6:47
    memberpjnaughter24-Sep-03 6:47 
    Questionwhich size of chunks in InternetReadFile is the safest best? Pin
    Valera2411761-Apr-03 4:24
    memberValera2411761-Apr-03 4:24 
    AnswerRe: which size of chunks in InternetReadFile is the safest best? Pin
    pjnaughter1-Apr-03 10:31
    memberpjnaughter1-Apr-03 10:31 
    Generalresuming download Pin
    Parasuraman SundarRajan & J. Naresh Kumar8-Apr-02 21:39
    memberParasuraman SundarRajan & J. Naresh Kumar8-Apr-02 21:39 
    GeneralRe: resuming download Pin
    pjnaughter10-Jan-03 11:23
    memberpjnaughter10-Jan-03 11:23 
    GeneralProgressBar is not working properly Pin
    Anonymous5-Mar-02 16:37
    memberAnonymous5-Mar-02 16:37 
    GeneralRe: ProgressBar is not working properly Pin
    pjnaughter10-Jan-03 11:25
    memberpjnaughter10-Jan-03 11:25 
    GeneralRe: ProgressBar is not working properly Pin
    Xenion28-Jun-03 4:24
    memberXenion28-Jun-03 4:24 
    GeneralRe: ProgressBar is not working properly Pin
    pjnaughter28-Jun-03 5:38
    memberpjnaughter28-Jun-03 5:38 
    GeneralRe: ProgressBar is not working properly Pin
    pjnaughter29-Jun-03 3:17
    memberpjnaughter29-Jun-03 3:17 
    Generalwonderful job,but small problem Pin
    marutis3-Mar-02 23:21
    membermarutis3-Mar-02 23:21 
    GeneralDownloading only a part of a file Pin
    Arkadi Stephan11-Nov-01 13:59
    memberArkadi Stephan11-Nov-01 13:59 
    GeneralRe: Downloading only a part of a file Pin
    pjnaughter10-Jan-03 11:26
    memberpjnaughter10-Jan-03 11:26 
    GeneralNew Version Pin
    Darroll Walsh17-Sep-01 12:47
    memberDarroll Walsh17-Sep-01 12:47 
    QuestionSame class without the dialog? Pin
    Anonymous26-Jul-01 9:11
    memberAnonymous26-Jul-01 9:11 
    AnswerRe: Same class without the dialog? Pin
    pjnaughter10-Jan-03 11:28
    memberpjnaughter10-Jan-03 11:28 
    You should be able to achieve this affect by playing around with the visibility window atrribute of the dialog resource I use.
    GeneralMinor bug in Authentication code Pin
    Jan Bares23-Jul-01 2:55
    memberJan Bares23-Jul-01 2:55 
    GeneralHTTPS Pin
    Anonymous29-Jun-01 4:16
    memberAnonymous29-Jun-01 4:16 
    GeneralCannot download EXE and DLL files Pin
    Rajneesh Sehgal18-Jan-01 7:37
    memberRajneesh Sehgal18-Jan-01 7:37 
    GeneralRe: Cannot download EXE and DLL files Pin
    pjnaughter10-Jan-03 11:31
    memberpjnaughter10-Jan-03 11:31 
    GeneralRe: Cannot download EXE and DLL files Pin
    Anonymous10-Jan-03 17:32
    sussAnonymous10-Jan-03 17:32 
    GeneralI want to apply this class to another project.... but Pin
    Bruce Nam11-Apr-00 17:14
    sussBruce Nam11-Apr-00 17:14 
    GeneralRe: I want to apply this class to another project.... but Pin
    PJ Naughter16-May-00 14:52
    sussPJ Naughter16-May-00 14:52 
    GeneralRe: I want to apply this class to another project.... but Pin
    mindows11-Feb-03 14:34
    membermindows11-Feb-03 14:34 

    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.

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