How to use the uikit.upload function in uikit

To help you get started, we’ve selected a few uikit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unite-cms / unite-cms / src / Bundle / StorageBundle / Resources / webpack / vue / field / File.vue View on Github external
mounted() {

            // If this file input is inside a collection, we can allow multi-upload.
            this.multiFileCollectionRow = this.findClosestCollectionRow(this.$el);

            // Init upload element.
            let t = this;
            let uploader = UIkit.upload(this.$el, {

                multiple: this.multiFileCollectionRow,
                name: 'file',
                type: 'PUT',
                allow: '*.' + (this.fileTypes ? this.fileTypes : '*').split(',').join('|*.'),

                beforeAll: () => {
                    this.error = null;
                    this.loading = true;
                },
                completeAll: () => {
                    this.fileName = this.tmpFileName;
                    this.fileSize = this.tmpFileSize;
                    this.fileType = this.tmpFileType;
                    this.fileId = this.tmpId;
                    this.checksum = this.tmpChecksum;
github RyanSusana / elepy / admin / src / main / resources / frontend / src / components / fields / FileField.vue View on Github external
mounted() {
            let vm = this;

            let id = "div[property=" + vm.field.name + "] > div[uid='" + vm._uid + "'] .js-upload";

            let upload = document.querySelector(id);
            UIkit.upload(upload, {
                url:
                    Utils.url +
                    "/uploads" +
                    "?maximumFileSize=" +
                    vm.field.maximumFileSize +
                    "&allowedMimeType=" +
                    encodeURIComponent(vm.field.allowedMimeType),
                name: "files",
                multiple: false,

                msgInvalidMime: "Invalid file type, must be %s",
                mime: vm.field.allowedMimeType,


                error: function (response) {
                    if (response.xhr == null) {
github opencorero / opencore / modules / Developer / Resources / assets / js / tasks / components / ImportButton.vue View on Github external
mounted() {
      UIkit.upload('.js-upload', {
        url: this.url,
        method: "POST",
        name: "tasks",
        beforeSend: function (environment) {
          environment.headers['X-CSRF-TOKEN'] = window.axios.defaults.headers.common['X-CSRF-TOKEN'];
        },
        beforeAll: function () {
          this.importing = true;
        },
        completeAll: function () {
          this.importing = false;
          window.location.reload(true);
        }
      });
    }
  }