No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [SOLVED] QUploader & QFile on Android

    Framework
    1
    2
    383
    Loading More Posts
    • 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.
    • S
      samodraland last edited by samodraland

      Hi guys,

      I use QUploader for Cordova development. On web/desktop mode, “plus” icon QUploader can open file browser, but when I build it to Android with Cordova, “plus” sign can’t open file browser.
      Did I miss configuration or some code lines?

      1 Reply Last reply Reply Quote 0
      • S
        samodraland last edited by samodraland

        SOLVED

        Just FYI to whoever read this. After try & error I found that different platform has different behaviour when handling “accept” attribute.
        What I did for QUploader & QFile to set accept props value from computed:

        <q-uploader :accept="accept"> or <q-file :accept="accept">
        
        export default{
          computed: {
            accept () {
              return this.$q.platform.is.cordova ? 'image/*' : '.jpg, .jpeg, .png'
            }
          },
        }
        

        based on this https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers I have tried use one of them (just extension or MIME) or combine file extension and MIME type but none of them were working. Have to use one option based on platform

        1 Reply Last reply Reply Quote 1
        • First post
          Last post