A Uploadcare component for A-Frame.
npm install aframe-uploadcare-componentA Uploadcare component for A-Frame.
For A-Frame.
| Property | Description | Default Value |
| -------- | ----------- | ------------- |
| publicKey | You uploadcare's public key | |
upload(value, contentType)download(fileId, callback, binary)uploadcare-upload-started: Upload started.uploadcare-upload-completed Upload completed succesfully:url: Uploadcare CDN url of the uploaded resource.fileInfo: Uploadcare fileInfo object.uploadcare-upload-error: Something went wrong when uploading.errorInfo: Error info.fileInfo: Uploadcare fileInfo object.uploadcare-upload-progress, {progress: uploadInfo.progress, uploadInfo: uploadInfo})progress: Percentage of the current upload progress.uploadInfo: uploadInfo object#### Browser
Install and use by directly including the browser files:
``html
#### npm
Install via npm:
`bash
npm install aframe-uploadcare-component
`Then require and use.
`js
require('aframe');
require('aframe-uploadcare-component');
`$3
#### Upload a JSON
`javascript
var sceneEl = document.querySelector('a-scene');
sceneEl.addEventListener('uploadcare-upload-completed', function (url) { alert('Uploaded: ' + url);});
sceneEl.upload(jsonObject, 'application/json');
`#### Download a JSON
`javascript
var sceneEl = document.querySelector('a-scene');
sceneEl.download(url, function (data) {
console.log('Loaded data', data);
});
``