I want to build the system that allows the client to upload the geojson files from html form and this data will show on the leaflet map. While I try to do so, It shows the error code 405. I want to submit the form containing geojson file and load this file using leaflet-omnivore plugin.
My html file as,
<section class="addVectorLayer">
<form action="" method="POST" class="vector">
Click to add your vector layer. It support Json, Geojson, csv, gpx and kml formats.
<input type="file" name="files" id="input_files">
</form>
</section>
my js file is here,
geojson.onlode = function() {
geojson.readAsDataURL(document.getElementById('input_files').files[0]);
};
omnivore.geojson(geojson.result).addTo(map);
Edit
Sorry This is not the duplicated one. In this question, I want to read the geojson file using omnivore leaflet-plugin.