mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-04 21:24:00 +01:00
18 lines
415 B
JavaScript
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
|
|
}
|
|
}
|
|
} |