[ckan-dev] CKAN API Clients

Sean Hammond sean.hammond at okfn.org
Tue Apr 24 10:36:54 UTC 2012


> > Moreover, in my use case, not only does a new resource need to be created
> > by the CKAN client api, but the resource actually needs to reside on the
> > CKAN server. I.e. It will need to be uploaded to the filestore. The data
> > model of a resource only has a 'url' field (presumably for linked
> > resources) which suggests to me that support for uploading files may not
> > be a trivial undertaking. Perhaps someone can dispel my hunch?
> 
> I've not looked into this part of CKAN before, but I think the place to
> start would be these chapters of the docs:
> 
> http://docs.ckan.org/en/latest/filestore.html
> 
> http://docs.ckan.org/en/latest/datastore.html#datastorer

I talked with rossjones about this in the #ckan irc channel. One idea we
had was that you could just copy your files to a public-readable
directory on your webserver (e.g. using scp, rsync, etc.) and then use
the CKAN package_create and package_update API calls to add the files to
CKAN as 'link to file' resources rather than using CKAN to actually
upload the file.

Obviously real resource upload support in CKAN's API would be better.
The task would be to look into how the web UI handles resource uploading
and see whether this functionality can be hooked up to the API.




More information about the ckan-dev mailing list