[ckan-dev] problem with custom download utf-8

Michael Reichart michael.reichart at gmail.com
Thu Mar 16 08:52:57 UTC 2017


Hi,

I'm trying to let my users download an excel list of their datasets, which
works in principle.
The file is being generated and when I get it direct from the server (ftp
...) everything is ok.
When I try to let the users download the file in the browser (putting the
file in a public folder and creating a simple href - Link) CKAN complains
that there is some type of unicode-error:

[ckan.lib.jinja_extensions] Template corruption in
`/public/exportFiles/test.xls` unicode decode errors
Error - <type 'exceptions.UnicodeDecodeError'>: 'utf8' codec can't decode
byte 0xd0 in position 0: invalid continuation byte

The problem seems to me, that jinja2 tries to read and deocde the file,
which fails because of some characters (although I tried to encode every
single character to utf-8) - but why does jinja even care about this file?
Is there another/better way to download files?

Thanks!
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20170316/c31fd660/attachment-0002.html>


More information about the ckan-dev mailing list