Some success exporting and importing apps on android.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4826 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -1042,11 +1042,11 @@ async function appExport() {
|
||||
zip.file(`${name}/${file}`, gFiles[file].buffer ?? gFiles[file].doc.doc.toString());
|
||||
}
|
||||
let content = await zip.generateAsync({
|
||||
type: 'blob',
|
||||
type: 'base64',
|
||||
compression: 'DEFLATE',
|
||||
});
|
||||
let a = document.createElement('a');
|
||||
a.href = URL.createObjectURL(content);
|
||||
a.href = `data:application/zip;base64,${content}`;
|
||||
a.download = `${owner}_${name}.zip`;
|
||||
a.click();
|
||||
}
|
||||
@ -1079,10 +1079,11 @@ async function appImport() {
|
||||
try {
|
||||
for (let file of input.files) {
|
||||
if (file.type != 'application/zip') {
|
||||
console.log('This does not look like a .zip.');
|
||||
console.log(`This does not look like a .zip (${file.type}).`);
|
||||
continue;
|
||||
}
|
||||
let buffer = await file.arrayBuffer();
|
||||
let buffer = new Uint8Array(await file.arrayBuffer());
|
||||
console.log('ZIP', file.name, file.type, buffer, buffer?.byteLength, buffer?.length);
|
||||
let zip = new JsZip();
|
||||
await zip.loadAsync(buffer);
|
||||
let app_object;
|
||||
|
Reference in New Issue
Block a user