angular-meteor-docs icon indicating copy to clipboard operation
angular-meteor-docs copied to clipboard

Step #20.25 Upload not working

Open acaneva opened this issue 9 years ago • 0 comments

[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

acaneva avatar Nov 21 '16 15:11 acaneva