[ckan-dev] Handling of text based files with unknown extensions
Aaron McGlinchy
McGlinchyA at landcareresearch.co.nz
Thu Jun 26 23:24:14 UTC 2014
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
More information about the ckan-dev
mailing list