Results 1 to 5 of 5

Thread: downloading from a site

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    downloading from a site

    I just want to download a picture from a site...how do I do it

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    perhaps this will help...

    URLDownLoadToFile
    Downloads bits from the Internet and saves them to a file. The client can optionally be notified of progress by means of a notification callback.

    HRESULT URLDownloadToFile(
    LPUNKNOWN pCaller, // Caller's controlling IUnknown
    LPCWSTR szURL, // Pointer to URL to be downloaded
    LPCTSTR szFileName, // Pointer to file name
    DWORD dwResv, // Reserved for future use
    LPBINDSTATUSCALLBACK lpfnCB
    // Caller's IBindStatusCallback
    );

    Parameters
    pCaller
    [in] Pointer to the caller's controlling IUnknown. If the caller is not an ActiveX component, this value may be set to NULL.
    szURL
    [out] Pointer to the URL to be downloaded. Cannot be NULL.
    szFileName
    [out] Pointer to the name of the file returned by this function. The user should pass a buffer to be filled and, preferably, use MAX_PATH to allocate the maximum path size.
    dwResv
    [in] Reserved for future use; must be zero.
    lpfnCB
    [in] Pointer to the caller's IBindStatusCallback interface. Can be NULL.
    Return Values
    This function returns the same values as IBindHost::MonikerBindToStorage.

    Remarks
    URLDownloadToFile calls the caller's IBindStatusCallback interface to provide notifications during the binding process. In particular, URLDownloadToFile calls IBindStatusCallback::OnProgress to report the ongoing status of the download. The caller does not need not implement any of the notification callbacks for the function to succeed, but doing so allows the client to receive notifications, if interested, and also allows downloads to be canceled by returning E_ABORT from the OnProgress call.

    If pCaller is non-NULL, the caller is a COM object that is contained in another component, such as an ActiveX Control in the context of an HTML page. In this case, the function attempts the download in the context of the ActiveX client framework and allows the caller's container to receive callbacks on the progress of the download.
    From MSDN

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    jim mcnamara
    Guest
    Another api, part of shdocvw.dll (IE 4.0 and up)

    PHP Code:

    char 
    *szFilename "http://www.downloads.com/myfiles/myfile.bmp";
    long DoFileDownload(szFilename); 
    This displays the dialog as well.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    how would I put that into a file? can fstream also do gif files and bitmaps?

    btw thanks guys...that will do perfect!

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    oh never mind.... thanks guys those will do just perfect!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width