Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how to download a file from geoserver gml from a url using javascript?

I'm doing a web application with javascript, but I could not download files from geoserver, the url given entry does not bring any result.

enter the url using this instruction:

new Ext.form.TextField({
                disabled: false,
                        fieldLabel: "URL GML",

to save a link:

var Ugml = Ext.getCmp('Ugml').getValue()

to fetch the data:

xmlhttp = new XMLHttpRequest();"GET", Ext.getCmp('Ugml').getValue(),true, User="admin",Password="geoserver");

any ideas

Thanks for your answers

share|improve this question
MY urL… – ricardo Dec 3 '10 at 20:07
up vote 5 down vote accepted

I would really need to see your URL to comment on why it doesn't work. Have you tried something like

In general though WFS requests are made using POST (not GET) with an XML payload to handle the request as it is easy to run into URL length limits before the request gets too complex.

Finally I'd recommend using OpenLayers and GeoEXT to provide this functionality with well tested code that saves you the work of developing and testing.

share|improve this answer
hi, thanks for your help, but geoserver not retorn nothing :S – ricardo Dec 3 '10 at 23:11
does any interaction with your GeoServer work? Try the demo requests to see if you have correctly set things up. – iant Dec 4 '10 at 20:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.