We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b6cea2 commit 3e20409Copy full SHA for 3e20409
src/index.js
@@ -39,11 +39,13 @@ class CoCreateUrlUploader {
39
const response = await fetch(file.src);
40
41
if (!response.ok) {
42
- throw new Error('Failed to fetch file: ' + response.statusText);
+ data.error = 'Failed to fetch file: ' + response.statusText
43
+ if (data.socket)
44
+ return this.crud.wsManager.send(data)
45
}
46
47
const arrayBuffer = await response.arrayBuffer();
- file.src = arrayBufferToBase64(arrayBuffer)
48
+ file.src = this.arrayBufferToBase64(arrayBuffer)
49
50
file.size = arrayBuffer.byteLength
51
file['content-type'] = response.headers.get('content-type')
0 commit comments