Search code examples
websocketvue.jsvuejs2feathersjsquasar-framework

How to use QUploader (Quasar-Framework) with websockets?


QUploader is documented here and here is its code.

I am trying to get QUploader (Quasar-framework version 0.14.7) working uploading images to a featherjs 'service' on external server, basically following along this example.

How do I use QUploader with websockets?


Solution

  • I tried to make feathersjs upload work without Quasar, that didn't work, but I am able to make Quasar work with a normal Express multer upload.

    You just use add :upload-factory="uploadFile" to the q-uploader component.

    The method goes like this: uploadFile(file, updateProgress)

    And you can do whatever with the file what you want, and you can calculate the progress and call updateProgress(calculatedProgress) with calculatedProgress going from 0.0 to 1.0.

    (Just make sure you have feathers-client wokring through websockets, then use Axios or something else on the client to upload it through websockets)

    It's all explained here