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

Alex (Maxious) Sadleir maxious at gmail.com
Thu Jun 26 23:39:10 UTC 2014


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



More information about the ckan-dev mailing list