Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step #20.25 Upload not working #298

Open
acaneva opened this issue Nov 21, 2016 · 0 comments
Open

Step #20.25 Upload not working #298

acaneva opened this issue Nov 21, 2016 · 0 comments

Comments

@acaneva
Copy link

acaneva commented Nov 21, 2016

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant