PDA

View Full Version : Download error



brcontainer
1st May 2013, 18:09
trying to direct the current page for a download error console returns the following message:


Frame load interrupted by policy change

Source (javascript+html):


function Download(){
window.location = "app.exe";
}
<a href="javascript:void(Download())">Start Download</a>

Console Preview:

9004

Should I configure something in the Compiler or QWebSettings?

wysota
1st May 2013, 19:02
How is this related to Qt?

brcontainer
1st May 2013, 20:45
Thanks for the quick response.

@wysota, this error (safety block) only occurs in QtWebKit.

In other browsers (non-QtWebKit) as Firefox, Chrome and Safari, this problem does not occur, so I think it is some setting that I have to do in QWebSettings (or something)

Thus a problem must be setup QWebSettings or compiler.

Please if you know why help me. Grateful.

wysota
1st May 2013, 21:48
www.google.com/?q=Frame+load+interrupted+by+policy+change

brcontainer
3rd May 2013, 14:53
I've searched on google before posting (to no avail).

The download works perfectly, what I want to know is why that message.

Thanks.

wysota
6th May 2013, 08:46
Ask in some WebKit forum. You can see the error is related to non-Qt WebKit ports as well so it's likely an upstream issue.

brcontainer
19th June 2013, 21:39
I discovered. In conventional Webkit browsers, the place to download the console shows how the request canceled, so before turning to "download manager" of the browser the request should be canceled.

solution:


//replace [QWebView] by your WebView
connect([QWebView]->page(), SIGNAL(unsupportedContent(QNetworkReply*)),
this, SLOT(downloadContent(QNetworkReply*)));

...

void [main class]::downloadContent(QNetworkReply *reply){
//Replace "[main class]" by "Class" having the signs used in WebView.

[QWebView]->stop();
//solution: stop loading --replace [QWebView] by your WebView

/*function to donwload*/
}

http://stackoverflow.com/questions/16278747/error-downloading/16782607#16782607