Skip to content

Step #20.25 Upload not working #298

Description

@acaneva

[Socially Angular1]

Hi,
As readAsArrayBuffer is deprecated, I´ve adjusted imports/api/images/methods.js to:

export function upload(dataUrl, name, resolve, reject) {
  // convert to Blob
  const data = dataURLToBlob(dataUrl);
  data.name = name;

  // pick from an object only: name, type and size
  const file = _.pick(data, 'name', 'type', 'size');


  const worker = new UploadFS.Uploader({
    store: ImagesStore,
    data: data,
    file: file,
    onError: reject,
    onComplete: resolve
  });

  worker.start();
}

So blobToArrayBuffer is no longer needed in imports/api/images/helpers.js

Hope it helps

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions