-3

URLDownloadToFile not working this is what im doing

URLDownloadToFile( NULL, "https://pastebin.com/raw/Q91mE8Qe", "C:/text.txt", 0, NULL);

and it's not download the file.. any help would be cool

  • Possible duplicate of [Programmatically reading a web page](https://stackoverflow.com/questions/389069/programmatically-reading-a-web-page) – frslm Oct 31 '17 at 20:56
  • @frslm Check the new question.. I am going to do it a different way – Blooze Amazon Oct 31 '17 at 21:27
  • 1
    What is the actual return value of `URLDownloadToFile()`? Note that `URLDownloadToFile()` is very unreliable and lacks good error reporting. Consider switching to WinInet/WinHTTP instead, or any other HTTP library, for that matter. – Remy Lebeau Oct 31 '17 at 21:55
  • You should add tags with more information. If you *just* have the C++ tag, it looks like you’re asking about generic C++, when [`URLDownloadToFile`](https://msdn.microsoft.com/en-us/library/ms775123(v=vs.85).aspx) appears to be Microsoft-specific. – Daniel H Oct 31 '17 at 21:57
  • I expect that the issue is you don’t have permission to write to `C:\text.txt` as whatever user you’re running your program from, but I definitely don’t have enough information to be confident in that. – Daniel H Oct 31 '17 at 21:59
  • Thanks everyone.. I solved it – Blooze Amazon Oct 31 '17 at 22:35

1 Answers1

0

fixed it with

URLDownloadToFile( NULL, "https://pastebin.com/raw/Q91mE8Qe/index.html", "C:/text.txt", 0, NULL);

I just forgot to include /index.html