E
E
Explida2016-10-05 17:22:08
C++ / C#
Explida, 2016-10-05 17:22:08

How to download a file in the background from a site with a username and password?

Good afternoon. There was a problem uploading a file.
In the browser, if the download is not authorized, it opens a new window for entering a username and password. If you enter the site and click download, it immediately opens the save dialog. (the site uses cookies)
Well, the problem itself:
I have a link to the image, I upload it through the webclient and nothing happens because the site uses authorization;
visited through the webbrowser logged in and downloads, that's just the dialog box shows (found in Google the solution in the background to download, but again it uses the webclient).
Well, the question itself is how to download in the background without showing dialog boxes?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2016-10-05
@Explida

A) Log in via WebBrowser, take the cookie, give it to WebClient, download the file;
B) Understand how the authorization on the site takes place, carry it out using the WebClient, get the cookie, set it in the request to download the file, download the file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question