Home > Software engineering >  The WebBrowser control direct download the file
The WebBrowser control direct download the file

Time:09-23

How to use that to download the file to the specified directory and not pop up save dialog? Use the following code: Private Sub Form1_Load (sender As Object, As EventArgs e) Handles MyBase. Load
WebBrowser1. Navigate (" https://www.dropbox.com/s/jdi4qlkqi9jrr30/TESTING.txt? Dl=1 ")
End Sub

CodePudding user response:

How to avoid pop-up save dialog? Done, please help to look at, not enough 40 points from,

CodePudding user response:

If the "access to this web site, download files directly",
Then a dialog box is inevitable, because this is the "core IE encapsulation processing method",

If this kind of circumstance, so you can't limit method, with the effect of this method is that,
To "no" is a dialog box should change a way of thinking:
With XMLHTTP object "web page code", for instance analytic target URL, and then use the API to download files,

CodePudding user response:

Display dialog: I don't think so, such as operation can be hidden save dialog box, and then save the file to the fixed path

CodePudding user response:

reference weixin_35804685 reply: 3/f
I don't think display dialog, such as operation can be hidden save dialog box, and then save the file to a fixed path

What are you understand what I mean!

Ask you again in another way:
If you say that the url input to the IE address bar and press enter "access to web sites,"
It is directly out of "file download dialog box?"
Or the main points of the page after a "download link", to begin to download file?

CodePudding user response:

references a drink, 4/f, the bright moon response:
Quote: refer to the third floor weixin_35804685 response:

Display dialog: I don't think so, such as operation can be hidden save dialog box, and then save the file to a fixed path

What are you understand what I mean!

Ask you again in another way:
If you say that the url input to the IE address bar and press enter "access to web sites,"
It is directly out of "file download dialog box?"
Or the main points of the page after a "download link", to begin to download file?

to access the website can directly download the pop-up dialog, after what I use is Google browser

CodePudding user response:

Why not use libcurl?

CodePudding user response:

reference 5 floor weixin_35804685 reply:
Quote: reference to toast to invite the bright moon, 4/f response:
Quote: reference weixin_35804685 reply: 3/f

Display dialog: I don't think so, such as operation can be hidden save dialog box, and then save the file to a fixed path

What are you understand what I mean!

Ask you again in another way:
If you say that the url input to the IE address bar and press enter "access to web sites,"
It is directly out of "file download dialog box?"
Or the main points of the page after a "download link", to begin to download file?

to access the website can directly download the pop-up dialog, after what I use is Google browser

I let you use IE try!!!!!!!!!!
Visible, said along while, you don't understand I say what is the meaning of! I said that what is the "purpose" of!!!!!!!!!!

Google, UC, Opera and so on are "default download save the path Settings," of course it will not play box,
Since you said "can be downloaded directly after Google access url," you should "IE to access the website" download dialog will play!
Likewise, use the WebBrowser control access, it is the same, because it is the core, IE

CodePudding user response:

URLDownLoadToFile
Downloads bits from the Internet and saves them to a file. The client can optionally be notified of the progress by means of a notification callback.

HRESULT URLDownloadToFile (
LPUNKNOWN pCaller,//Caller 's controlling IUnknown
LPCWSTR szURL,//a Pointer to the URL to be downloaded
LPCTSTR szFileName,//a Pointer to the file name
DWORD dwResv,//Reserved for future use
LPBINDSTATUSCALLBACK lpfnCB
//Caller 's IBindStatusCallback
);

The Parameters
PCaller
[in] Pointer to the caller 's controlling IUnknown. If the caller is not an ActiveX component, this value may be set to NULL.
SzURL
[out] Pointer to the URL to be downloaded. Always be NULL.
SzFileName
[out] Pointer to the name of the file returned by this function. The user should pass a buffer to be filled and, preferably, use MAX_PATH to the allocate the maximum path size.
DwResv
[in] Reserved for future use. Must be zero.
LpfnCB
[in] Pointer to the caller 's IBindStatusCallback interface. Can be NULL.
The Return Values
This function returns the same values as IBindHost: : MonikerBindToStorage.

Few
URLDownloadToFile calls the caller's IBindStatusCallback interface to provide notifications during the binding process. In particular, URLDownloadToFile calls IBindStatusCallback::OnProgress to report the ongoing status of the download. The caller does not need not implement any of the notification callbacks for the function to succeed, but doing so allows the client to receive notifications, if interested, and also allows downloads to be canceled by returning E_ABORT from the OnProgress call.

If pCaller is non - NULL and the caller is a COM object that is contained in another component, to the as an ActiveX Control in the context of an HTML page. In this case, the function attempts the download in the context of the ActiveX client framework and allows the caller 's container to receive callbacks on the progress of the download.

QuickInfo
Windows NT: Use version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in urlmon. H.

See Also
IBindStatusCallback, IBindStatusCallback: : OnProgress




null
  • Related