Results 1 to 7 of 7

Thread: Download error

  1. #1
    Join Date
    Apr 2013
    Posts
    65
    Thanks
    4
    Thanked 3 Times in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Question Download error

    trying to direct the current page for a download error console returns the following message:

    Frame load interrupted by policy change
    Source (javascript+html):

    Qt Code:
    1. function Download(){
    2. window.location = "app.exe";
    3. }
    4. <a href="javascript:void(Download())">Start Download</a>
    To copy to clipboard, switch view to plain text mode 

    Console Preview:

    dwaSI.png

    Should I configure something in the Compiler or QWebSettings?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Download error

    How is this related to Qt?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2013
    Posts
    65
    Thanks
    4
    Thanked 3 Times in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Download error

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Download error

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2013
    Posts
    65
    Thanks
    4
    Thanked 3 Times in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Download error

    I've searched on google before posting (to no avail).

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

    Thanks.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Download error

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Apr 2013
    Posts
    65
    Thanks
    4
    Thanked 3 Times in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Download error

    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:

    Qt Code:
    1. //replace [QWebView] by your WebView
    2. connect([QWebView]->page(), SIGNAL(unsupportedContent(QNetworkReply*)),
    3. this, SLOT(downloadContent(QNetworkReply*)));
    4.  
    5. ...
    6.  
    7. void [main class]::downloadContent(QNetworkReply *reply){
    8. //Replace "[main class]" by "Class" having the signs used in WebView.
    9.  
    10. [QWebView]->stop();
    11. //solution: stop loading --replace [QWebView] by your WebView
    12.  
    13. /*function to donwload*/
    14. }
    To copy to clipboard, switch view to plain text mode 

    http://stackoverflow.com/questions/1...82607#16782607

Similar Threads

  1. Replies: 1
    Last Post: 10th September 2012, 02:16
  2. From where should I download QML
    By prajnaranjan.das in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2011, 20:54
  3. Download a web page!
    By Faster in forum Newbie
    Replies: 0
    Last Post: 12th April 2009, 14:35
  4. Download Manager Like IDM(Internet Download Manager)
    By sathiskumarmsk in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2008, 16:52
  5. Qtopia Download
    By AP.Sakkthivel in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 26th July 2007, 10:51

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.