[SOLVED] QUploader & QFile on Android



  • 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?



  • 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


Log in to reply