smas1 / geoext-viewer

Automatically exported from code.google.com/p/geoext-viewer
GNU General Public License v3.0
0 stars 0 forks source link

Downloading Shapefiles in IE fails #380

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open EditorBasics example
2. Draw a simple polygon
3. Click Download geometries

What is the expected output? What do you see instead?
IE reports editor.zip couldn't be downloaded
Fiddler reports an error: Content length mismatch: Response header indicated 
738 bytes, but server sent 730 bytes.

Tested in IE11 and IE8 (emulated)

Original issue reported on code.google.com by Martijn....@gmail.com on 23 May 2014 at 11:48

GoogleCodeExporter commented 9 years ago
The content-length was not always calculated correctly. Only IE complained 
about this, also as a protocol error. Only for untranslated (via ogr2ogr) data 
the length of newlines need to be added to len(data). For converted data, the 
datalen should be the filesize. Also we need to take into account the length of 
the CRs, so for untransformed data the total length becomes:

        data_len = len(data) + data.count('\n') + data.count('\r')

While for transformed (via ogr2ogr, possibly zipped) the data_len becomes:

                data_len = os.path.getsize(out_file)

This is now added to heron.cgi

Original comment by jus...@gmail.com on 23 May 2014 at 12:16

GoogleCodeExporter commented 9 years ago
The changes rev 1484 are not working for me - IE8 + FF 29.0.1 -> no XLS 
download from featureinfo! Before rev 1484 I could download geometries(WKT) - 
the thing is, that you must have the compatibility modus of the IE browser OFF. 

Original comment by wolfram.winter on 26 May 2014 at 6:54

GoogleCodeExporter commented 9 years ago
Confirmed, the content-length was incorrectly calculated for non-transformed 
data most notably XML-based XLS, where data length was calculated before 
decoding the Base64/URLencoded form-data.  Should be fixed with rev 1490,  Try 
e.g. the example http://lib.heron-mc.org/heron/latest/examples/multisearchcenter

Original comment by jus...@gmail.com on 26 May 2014 at 8:10

GoogleCodeExporter commented 9 years ago
With rev 1490 XLS works again - Thanks!!

Original comment by wolfram.winter on 26 May 2014 at 10:18

GoogleCodeExporter commented 9 years ago
By Wolfram: @Just: after all that struggling with IIS + GDAL one hint still 
remains: the CSV export of the featureinfo starts but no explorer download box 
is shown (IE8 + FF 29) - is this a header problem?

By Just: Well, there is some confusion about how to correctly calculate string 
length in Python w.r.t. newlines (as present in CSV). This may be different 
when running heron.cgi on windows. But I just changed back from 

    data_len = len(data) + data.count('\n') + data.count('\r')
to
    data_len = len(data)

And now I get back the right content-length for CSV.

Original comment by jus...@gmail.com on 26 May 2014 at 12:53

GoogleCodeExporter commented 9 years ago
@Just: great - with rev 1494 the CSV export works again (+ all other 
featureinfo exports) - Thanks!!

Original comment by wolfram.winter on 26 May 2014 at 1:40

GoogleCodeExporter commented 9 years ago
So all seems well: closing.

Original comment by jus...@gmail.com on 3 Jun 2014 at 3:06