[ckan-dev] Resource Filepath through API?
Alex (Maxious) Sadleir
maxious at gmail.com
Tue May 26 23:23:46 UTC 2015
Inside a extension, you can get the path if you have the resource object:
from ckan.lib import uploader
if resource.get('url_type') == 'upload':
upload = uploader.ResourceUpload(resource)
file_path = upload.get_path(resource['id'])
On Wed, May 27, 2015 at 12:03 AM, Timothy Giles <timothy.giles at slu.se> wrote:
> Hi,
>
>
>
> I wanted to add auto checksum (MD5…) to an extension I am writing, as
> resources are uploaded they are checksumed and this metadata added to the
> resource. I cant see where now, in the CKAN API I can get the file patch for
> a resource. In the depreciated API it was available as : def
> after_upload(self, context, pkg_dict, resource_id, file_path).
>
>
>
>
>
> Tim
>
>
> _______________________________________________
> 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