Skip to content

Commit 6a09eb2

Browse files
committed
Unwrap converted zip for file upload
1 parent 594de15 commit 6a09eb2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

services/import/file.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export class FileImporter {
6565
if (workspace.type === 'osw') {
6666
this._context.status = status.convertOsm;
6767
data = await this._tdeiClient.convertDataset(data, 'osw', 'osm', workspace.tdeiProjectGroupId);
68+
data = await this._unwrapConvertedDataset(data);
6869
}
6970

7071
this._context.status = status.createWorkspace;
@@ -84,6 +85,16 @@ export class FileImporter {
8485
return workspaceId
8586
}
8687

88+
async _unwrapConvertedDataset(zip: Blob): Blob {
89+
const zipReader = new ZipReader(new BlobReader(zip));
90+
const entries = await zipReader.getEntries();
91+
const out = await entries[0].getData(new BlobWriter());
92+
93+
await zipReader.close();
94+
95+
return out;
96+
}
97+
8798
async _handleError(e: any) {
8899
if (this._context.status === status.convertOsm) {
89100
this._context.error = 'Conversion job failed: ';

0 commit comments

Comments
 (0)