Save file directly to specified path without showing save or open dialogue

I’m invoking javascript in a web page using

webBrowser2.Document.InvokeScript("download_file");`. 

This javascript opens dialogue asking user to save or open the file. I want to save the file directly to the path without showing the dialogue to user. How can i achieve this. I’m scraping the web page. I’m extracting the required details from the web page.

download_file():

function download_file() {
    var summaryFlag = 0;
    if (document.getElementById("frmincludefilesummary").checked) {
        summaryFlag = 1;
    }
    url = '/filedatabase/file_process_request.html?mru=53616c7&type=doc';
    url += '&sum=' + summaryFlag + '&logo=0&xcode=name&serve_txt=0&folderid=';
    document.location = url;
}​

5 thoughts on “Save file directly to specified path without showing save or open dialogue”

  1. Nice post. I was checking continuously this blog and I’m inspired! Very helpful info particularly the last part 🙂 I take care of such info a lot. I used to be seeking this particular info for a very lengthy time. Thank you and best of luck.

    Reply

Leave a Comment