Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: 14 Apr 2005 14:19:34 -0700,    group: microsoft.public.inetsdk.programming.urlmonikers        back       


URLDownloadToFile Error -2147024891   
The URLDownloadToFile API returns the status code -2147024891 when
attempting to download from a valid HTTP or FTP location. If the URL is
pasted into the browser the file is downloaded thus verifying the
correctness and accessability of the URL. Any idea of the cause of this
behavious?
date: 14 Apr 2005 14:19:34 -0700   author:   Chamitha

Re: URLDownloadToFile Error -2147024891   
"Chamitha"  wrote in message
news:1113513574.536470.57320@f14g2000cwb.googlegroups.com
> The URLDownloadToFile API returns the status code -2147024891 when
> attempting to download from a valid HTTP or FTP location. If the URL
> is pasted into the browser the file is downloaded thus verifying the
> correctness and accessability of the URL. Any idea of the cause of
> this behavious?

The error is E_ACCESSDENIED. Are you, by any chance, calling 
URLDownloadToFile from a service running under SYSTEM account?
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Thu, 14 Apr 2005 17:29:01 -0400   author:   Igor Tandetnik

Re: URLDownloadToFile Error -2147024891   
No. Its is being called in a simple VB 6.0 EXE.
date: 14 Apr 2005 15:11:22 -0700   author:   Chamitha

Re: URLDownloadToFile Error -2147024891   
Sample

Dim RetCode As Long

RetCode = URLDownloadToFile(0,
"ftp://username:password@ftp.ftpurl.com/File.txt", "C:\Test\File.txt",
0, 0)

If Not (RetCode = 0) Then
    MsgBox "Boom" 'The message box is displayed. RetCode = -2147024891
End If
date: 14 Apr 2005 15:15:41 -0700   author:   Chamitha

Re: URLDownloadToFile Error -2147024891   
"Chamitha"  wrote in message
news:1113516941.936003.142960@l41g2000cwc.googlegroups.com
> Sample
>
> Dim RetCode As Long
>
> RetCode = URLDownloadToFile(0,
> "ftp://username:password@ftp.ftpurl.com/File.txt", "C:\Test\File.txt",
> 0, 0)

Do you have rights to write to this file? In Explorer, can you create a 
file in this directory?
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Thu, 14 Apr 2005 18:56:49 -0400   author:   Igor Tandetnik

Re: URLDownloadToFile Error -2147024891   
Yes.
date: 15 Apr 2005 06:57:43 -0700   author:   Chamitha

Re: URLDownloadToFile Error -2147024891   
This issue only occurs on some PC's. Others work fine. Is there any
Service Pack or Patch which causes or elimiates this?
date: 15 Apr 2005 13:08:55 -0700   author:   Chamitha

Re: URLDownloadToFile Error -2147024891   
Seems like the issue has something to do with a proxy.
URLDownloadToFile API executed on the same PC when connect to the
internet via a authenticated proxy server fails, but succeeds when
connected directly.
Any idea if the API can be used with a proxy server? If so are any
modifications required?
date: 17 Apr 2005 15:18:33 -0700   author:   Chamitha

Re: URLDownloadToFile Error -2147024891   
"Chamitha"  wrote in message
news:1113776313.292623.296940@l41g2000cwc.googlegroups.com
> Seems like the issue has something to do with a proxy.
> URLDownloadToFile API executed on the same PC when connect to the
> internet via a authenticated proxy server fails, but succeeds when
> connected directly.
> Any idea if the API can be used with a proxy server? If so are any
> modifications required?

You should be able to create a COM object that implements 
IBindStatusCallback and IAuthenticate, and pass it as the last 
parameter. You can then supply user name and password via 
IAuthenticate::Authenticate.

Another thing to try is InternetSetOption(NULL, 
INTERNET_OPTION_PROXY_USERNAME) and INTERNET_OPTION_PROXY_PASSWORD. I'm 
not sure if this works.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 18 Apr 2005 11:13:32 -0400   author:   Igor Tandetnik

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us