[ckan-dev] Filestore changes between 2.2a and 2.2b

Stéphane Guidoin stephane at opennorth.ca
Wed Feb 19 15:28:54 UTC 2014


Hello,

There seem to have some changes in the CKAN filestore (and its API) between
2.2a and 2.2b.

First the url changes (from a timestamp to the resource id), that's ok.

But to upload via the API, it seems it also changed. With 2.2b, I am able
to upload a file with this command:

curl -v http://myinstance/api/3/action/*resource_create* -H
"X-CKAN-API-Key:1111-22222-33333-44444" *--form upload=@/my/file/**example.xml
--form package_id=warandpeace*

But it does not work with 2.2a (get an JSON error)...

Erreur JSON : Error decoding JSON data. Error: JSONDecodeError('Expecting
value: line 1 column 2 (char 1)',) JSON data extracted from the request:
'------------------------------3051bfd2dd4a;\\r\\nContent-Disposition:
form-data; name=\"upload\"; filename=\"resource.csv\"\\r\\nContent-type:
application/octet-stream\\r\\n\\r\\nfield1,field2,field3\\n1,2,3\\n4,5,6\\n7,8,9\\n\\r\\n------------------------------3051bfd2dd4a;\\r\\nContent-Disposition:
form-data;
name=\"package_id\"\\r\\n\\r\\njuliotest\\r\\n------------------------------3051bfd2dd4a;--'"(ckanprod2.2a)



Does anyone knows why and what should be done to upload file for 2.2a?
*What will happen to the resources (and their URL) if upgrading from 2.2a
to 2.2b?*

Lastly: the management of releases since 2.2 is a bit startling. There's
just one tag/branch for 2.2 but obviously some serious code changes between
2.2a and 2.2b but there is not way to specifically request on subversion or
the other.

Thanks

Stéphane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140219/81bad154/attachment-0002.html>


More information about the ckan-dev mailing list