Google Answers Logo
View Question
 
Q: Implementing IDownloadManager interface ... ( No Answer,   2 Comments )
Question  
Subject: Implementing IDownloadManager interface ...
Category: Computers
Asked by: mightyjohnny-ga
List Price: $100.00
Posted: 02 Oct 2003 20:29 PDT
Expires: 01 Nov 2003 19:29 PST
Question ID: 262343
When my implementation of IDownloadManager.Download method is been
Invoked, I receive following parameters ..
<C++ declaration>
    IMoniker *pmk,
    IBindCtx *pbc,
    DWORD dwBindVerb,
    LONG grfBINDF,
    BINDINFO *pBindInfo,
    LPCOLESTR pszHeaders,
    LPCOLESTR pszRedir,
    UINT uiCP
<Object pascal declaration>
   pmk: IMoniker; 
   pbc: IBindCtx;
   dwBindVerb: DWORD;
   grfBINDF: DWORD; 
   pBindInfo: PBindInfo; 
   pszHeaders,
   pszRedir: PWidechar; 
   uiCP: UINT

I can use pmk->GetDisplayName to retrive the URL address being
downloaded , then pass the URL to related URLMoniker function to
perform the download operation . But what should I do when the
incoming file is posted back through a CGI program (using
httpRequest.BinaryWrite or similar method) but not a regular
Hyper-link ?

   For example , if I download a file from
http://www.somecompany.com/somefile.exe , pmk->GetDisplayName will
return a string equal to "http://www.somecompany.com/somefile.exe" ,
then I can pass the string to UrlDownloadToFile function to perform
download operation . But if I download a file from
http://www.somecompany.com/someasp.asp which will return somefile.exe
, the above operation will download the .asp file instead of the .exe
file .
   A complete example is prefered , but any useful information is
acceptable also .

Johnny
Answer  
There is no answer at this time.

Comments  
Subject: Re: Implementing IDownloadManager interface ...
From: yucca-ga on 05 Oct 2003 23:32 PDT
 
Look for a header named "content-disposition".  If it exists, it will
most likely give you the name of the file being sent to the browser.
Subject: Re: Implementing IDownloadManager interface ...
From: mightyjohnny-ga on 07 Oct 2003 19:22 PDT
 
Thanks for your comment . The problem here is how to get the related
HTTP header infomation during the callback . The pszHeaders and
pszRedir paramater are always null .

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy