Skip to content

Commit 3bacd95

Browse files
authored
Update README.md
1 parent 374e497 commit 3bacd95

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@ It uses the [offthread-image](https://github.com/sharedlabs/offthread-image) ele
1414
<file-uploader id="fileUploader"><file-uploader>
1515

1616
...
17-
this.$.fileUploader.addFile(file, {url, method, headers});
17+
const xhrParamsPromise = new Promise((resolve, reject) => {
18+
...
19+
resolve({url, method, headers});
20+
});
21+
22+
this.$.fileUploader.addFile(file, xhrParamsPromise);
1823
```
1924

25+
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.
26+
2027
### Browsers support
2128

2229
Any browser that supports Polymer 1.0

0 commit comments

Comments
 (0)