[ckan-dev] Resource Filepath through API?

Timothy Giles timothy.giles at slu.se
Wed May 27 04:59:19 UTC 2015


Thanks :-)
________________________________________
From: ckan-dev <ckan-dev-bounces at lists.okfn.org> on behalf of Alex (Maxious) Sadleir <maxious at gmail.com>
Sent: 27 May 2015 01:23 AM
To: CKAN Development Discussions
Subject: Re: [ckan-dev] Resource Filepath through API?

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
>
_______________________________________________
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