[ckan-dev] Handling of text based files with unknown extensions

Vitor Baptista vitor at vitorbaptista.com
Fri Jun 27 00:11:21 UTC 2014


Aaron,

As Alex already pointed out, this is a known bug and fixed on master. It's
marked to be backported to CKAN 2.2, but wasn't yet. In the mean time, you
could cherry-pick its commit into your local branch. It's small enough that
shouldn't create any problems.

Cheers,


2014-06-26 20:39 GMT-03:00 Alex (Maxious) Sadleir <maxious at gmail.com>:

> File extensions that are not recognised can cause server errors, a fix
> should be available soon (or try some of the patches on
> https://github.com/ckan/ckan/pull/1534 )
>
> On Fri, Jun 27, 2014 at 9:24 AM, Aaron McGlinchy
> <McGlinchyA at landcareresearch.co.nz> wrote:
> > Hi, I have encountered an issue whereby a user uploaded a nexus file (
> http://en.wikipedia.org/wiki/Nexus_file) which is in fact a text file
> with the extension .nex (or sometimes .nxs).  This unknown file extension
> caused CKAN to spit the dummy, returning an internal server error.
> >
> > In testing further I found that any txt file that is uploaded with an
> extension that CKAN does not recognise out of the box (e.g. as per
> http://docs.ckan.org/en/ckan-2.2/data-viewer.html#text-preview) causes
> this error.  In normal CKAn behaviour an unrecognised file format triggers
> a save dialog box if clicked on, but for these files which are underlying
> txt format but varying (undefined) extension they cause an error.
> >
> > I uploaded an example to the CKAN demo site
> http://demo.ckan.org/dataset/aarontests  so you can see what happens.
> >
> > I know that we can add extra extensions to ckan.preview.loadable to
> ensure the nex/nxs files get handled in future, but is there a way for as
> yet unknown extensions that people may use/upload with text files to be
> treated as per any other unknown format so as to not trigger the server
> error?
> >
> > Thanks
> > Aaron
> >
> > ________________________________
> >
> > Please consider the environment before printing this email
> > Warning: This electronic message together with any attachments is
> confidential. If you receive it in error: (i) you must not read, use,
> disclose, copy or retain it; (ii) please contact the sender immediately by
> reply email and then delete the emails.
> > The views expressed in this email may not be those of Landcare Research
> New Zealand Limited. http://www.landcareresearch.co.nz
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>



-- 

Vítor Baptista

Developer  |  http://vitorbaptista.com | LinkedIn
<http://www.linkedin.com/in/vitorbaptista> | @vitorbaptista
<http://twitter.com/vitorbaptista>

The Open Knowledge Foundation <http://okfn.org>

*Empowering through Open Knowledge*

http://okfn.org/  |  @okfn <http://twitter.com/okfn>  |  OKF on Facebook
<https://www.facebook.com/OKFNetwork>  |  Blog <http://blog.okfn.org/>  |
Newsletter <http://okfn.org/about/newsletter/>


Have you bought your tickets <http://2014.okfestival.org/tickets/> to
OKFestival yet? Join us in Berlin!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140626/7d384c29/attachment-0003.html>


More information about the ckan-dev mailing list