locked
URLDownloadFile Error RRS feed

  • Question

  •  I'm attempting to use URLDownloadToFile and it compiles fine, but when I run it I keep getting INET_E_DOWNLOAD_FAILURE

    I checked and double-checkked the website and the file is there. I put it there myself.

    Any ideas what the issue could be?

          hres=URLDownloadToFile(NULL,wremotefile.c_str(),wlocalfile.c_str(),0,NULL);

           if(hres == S_OK)
             return TRUE;
           else if(hres == E_OUTOFMEMORY)
             showtextmessage("Out Of Memory!");  
           else if(hres == INET_E_DOWNLOAD_FAILURE)
             showtextmessage("Download Failure!");  
           else
             showtextmessage("Undefined Error"); 

          I tried using URLDownloadToFileA and got the same error, and I've checked the values of the wremotefile and wlocalfile variables and they are correct.

    • Edited by TallGuy63 Friday, August 28, 2015 3:54 PM
    Friday, August 28, 2015 3:49 PM

Answers

  • never mind - turns out the web server is having issues...
    • Marked as answer by TallGuy63 Friday, August 28, 2015 4:29 PM
    Friday, August 28, 2015 4:29 PM

All replies

  • If the URL is invalid, INET_E_DOWNLOAD_FAILURE is returned.
    Friday, August 28, 2015 3:52 PM
  • The URL is correct.

    Friday, August 28, 2015 3:56 PM
  • never mind - turns out the web server is having issues...
    • Marked as answer by TallGuy63 Friday, August 28, 2015 4:29 PM
    Friday, August 28, 2015 4:29 PM