Closed GoogleCodeExporter closed 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
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
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
With rev 1490 XLS works again - Thanks!!
Original comment by wolfram.winter
on 26 May 2014 at 10:18
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
@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
So all seems well: closing.
Original comment by jus...@gmail.com
on 3 Jun 2014 at 3:06
Original issue reported on code.google.com by
Martijn....@gmail.com
on 23 May 2014 at 11:48