Closed maxschmi closed 2 years ago
Okay I solved the problem by myself.
The problem was that I did not enter the result of the buffer-Promise but the Promise to the shp function.
So my new code is:
let inputFile = document.getElementById("uploadFile");
inputFile.files[0].arrayBuffer().then((bufferResult) => {
shp.parseZip(bufferResult).then((geojson) => console.log(geojson))
});
Hallo, I'm trying to use this package to enable the users of my website to upload a zipped .shp file. For this purpose i have a file-Input where the user can choose the file.
out of this fileList i then get the arrayBuffer and hand that to the shp function. But when i do this I get the following error:![grafik](https://user-images.githubusercontent.com/46047581/129562277-a50f1b4d-1458-44b0-904e-f393d8908be2.png)
This is my code:
let inputFile = document.getElementById("uploadFile");
let buffer = inputFile.files[0].arrayBuffer();
shp.parseZip(buffer).then((geojson) =>console.log(geojson));
Where am I wrong or is there another problem?
Notice: I'm on a localhost server for developing purposes.