Skip to content

File uploader custom element with a material progress overlay 🔥

License

Notifications You must be signed in to change notification settings

sharedlabs/file-uploader

Repository files navigation

License

file-uploader

File uploader for multiple files with a progress bar.

It uses the offthread-image element to render the thumbnails so it performs awesome on slow devices like mobile phones.

Preview (Uploading files to Amazon S3)

Use

<file-uploader id="fileUploader"><file-uploader>

...
const xhrParamsPromise = new Promise((resolve, reject) => {
  ...
  resolve({url, method, headers});
});

this.$.fileUploader.addFile(file, xhrParamsPromise);

Why xhrParams as a promise? This is handy on enviroments like S3 when you have to ask for signed urls before uploading the files. This way that request is also part of the file uploading progress.

Browsers support

Any browser that supports Polymer 2.0-preview