Created
September 27, 2016 14:02
-
-
Save pavelpower/ff710e0a27405dad179902d66468c401 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
export default async function uploadFile(file, onProgressHandler) { | |
const fileData = { | |
parentFileId: '', | |
name: file.name, | |
tags: [], | |
description: file.name, | |
contentLength: file.size | |
}; | |
const registerResponse = await this::putFile(fileData); | |
const fileId = registerResponse.id; | |
await this::uploadFileToBucket(file, registerResponse, onProgressHandler); | |
await this::putUploadedState(fileId); | |
return await getImageData(registerResponse); | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment