Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Image. Server replied: Not Acceptable

Image. Server replied: Not Acceptable

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 652 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nulik
    wrote on last edited by
    #1

    I am allowing my users to add images as attachments, so the user provides a link, and I set it to the 'Image' item. But for some servers I get this error:

    qrc:/AttachmentList.qml:40:25: QML Image: Error transferring http://doggiedonyc.com/wp-content/uploads/2014/06/dog2.jpg - server replied: Not Acceptable

    Investigating further, I found that this is some problem with User-Agent string. But how do I change this value if I don't have access to QML internals?

    My QML source goes like this:

                        ```
                    Image {
                            id: attach_img
                            source:  (model.type===Attachments.A_TYPE_IMAGE) || (model.type===Attachments.A_TYPE_YOUTUBE) ? model.display_url : ""
                            width: app.width  * 0.9
                            fillMode: Image.PreserveAspectFit
                        }
    
    
    TIA
    1 Reply Last reply
    0
    • Shrinidhi UpadhyayaS Offline
      Shrinidhi UpadhyayaS Offline
      Shrinidhi Upadhyaya
      wrote on last edited by
      #2

      Hi @Nulik , i think the user-agent string needs a valid value,i guess QQmlNetworkAccessManagerFactory Class can you help you in that,you can have look into the documentation [https://doc.qt.io/qt-5/qqmlnetworkaccessmanagerfactory.html].

      Shrinidhi Upadhyaya.
      Upvote the answer(s) that helped you to solve the issue.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved