10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 13:13:55 +01:00
QUESTDB_website/static/js/websiteFile.js

18 lines
415 B
JavaScript

class websiteFile{
constructor(file){
this.file=file
}
async getViewerURL(){
var urlbase="/view"
switch (trueTypeOf(this.file)) {
case "string":
return String.raw`${urlbase}?file=${this.file}`
break
case "File":
var base64=btoa(await getTextFromUploadedFileAsync(this.file))
return String.raw`${urlbase}?fileBase64=${base64}`;
break
}
}
}