Giter Club home page Giter Club logo

Comments (4)

abjardim avatar abjardim commented on September 28, 2024

Can somebody give me a tip on how to handle this error when using XMLHttpRequest?
Below is the code I'm using. With it I'm able to open a download window with the zipped shapefile, but when I change the format to DXF I receive the error mentioned above.

    var http = new XMLHttpRequest();
    var url = "http://ogre.adc4gis.com/convertJson";
    var params = "json=" + JSON.stringify(resultAsGeojson) +
      "&skipFailures=" + true +
      "&format=" + "DXF";
    http.open("POST", url, true);
     
    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     
    http.onreadystatechange = function() {//Call a function when the state changes.
      var a;
      if(http.readyState == 4 && http.status == 200) {
            a = document.createElement('a');
            a.href = window.URL.createObjectURL(http.response);
            a.download = "test-file.zip";
            a.style.display = 'none';
            document.body.appendChild(a);
            a.click()
        }
    }

    http.responseType = 'blob';
    http.send(params);

I am very new to js, so thanks in advance!

from ogre.

GastonZalba avatar GastonZalba commented on September 28, 2024

The online version still has this issue unsolved, so DXF format is broken. Check this PR #87 if you want to try running your own instance.

from ogre.

wavded avatar wavded commented on September 28, 2024

This fix has been released, thx again @GastonZalba !

from ogre.

abjardim avatar abjardim commented on September 28, 2024

That's great, thank you!

from ogre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.