How to download a file with Awesomium ?

foozoor

Newbie
Joined
Nov 16, 2014
Messages
12
Reaction score
0
I tried a lot of thing to write a function that download a file through the Awesomium SDK in an off screen way.
Unfortunately, nothing works...

How to do it with Awesomium 1.7.5 ?

This is my very basic code...

Code:
using System;
using Awesomium.Core;

namespace AwesomiumTest
{
    class Program
    {
        public static void Main(String[] args)
        {
            // Download with Awesomium.
            string url = ""; // Sorry I can't provide an URL since I am a new member.
            string filename = "myfile.exe";
            BrowserDownload(url, filename);
        }

        public static void BrowserDownload(string url, string filename)
        {
            WebView view = WebCore.CreateWebView(1280, 720);
            view.Source = new Uri(url);
        }
    }
}

Thanks for your future help. ;)
 
Last edited:
Why not just use HttpWebRequests?


Quicker and easier


Code:
var wc = new WebClient();
//for a text file
var contents = wc.DownloadString("http://thefile.com/url-here");

//byte buffer
var buffer = wc.DownloadData("http://path.com/goes-here.jpeg");

//download file
wc.DownloadFile("http://urlhere.com", saveToPath);

This is from memory, so it may not be 100%
 
Back
Top