[ckan-dev] Uploading files via API - UR: Missing value error

Denis Zgonjanin deniszgonjanin at gmail.com
Tue Feb 3 15:39:35 UTC 2015


I've seen this. Just put any value for the url, such as an empty string so
that CKAN doesn't choke on it. The correct value will be auto-populated
with the uploaded file url

On Tue, Feb 3, 2015 at 10:01 AM, Krzysztof Madejski <
krzysztof.madejski at epf.org.pl> wrote:

> Hi,
>
> I'm trying to to upload file via CKAN API using Python api:
> https://github.com/ckan/ckanapi#file-uploads
>
> The problem is I'm getting {u'url': [u'Missing value'], u'__type':
> u'Validation Error'}
>
> I wonder what I'm doing wrong.
>
> Here's resource I'm uploading:
> resource_create: {"name": "Statystyki strukturalne maj 2014", "created":
> "2014-07-01T13:45:08", "package_id": "537b245ebdd0a48259924918", "upload":
> "/tmp/infona/5486df35bdd0789a545de155/Statystyki strukturalne maj
> 2014.zip", "state": "active", "last_modified": "2014-12-09T11:38:29",
> "revision_id": 2, "id": "53b2bb64bdd0a4825992535b"}
>
> And code responsible for uploading:
> r.update({
>                     'upload': open(local_path)
>                 })
> ckan.action.resource_create(**r)
>
> I guess that before validation file should be stored locally and that
> value should go into URL. But it should all be done internally. This
> scenario works perfectly from web interface.
>
> I'll be glad if you share some thoughts on this problem, if you've
> encountered it before.
>
> Krzysztof
>
> --
> Krzysztof Madejski
> Koordynator Koduj Dla Polski, Fundacja ePaństwo
> Code for Poland program manager, ePF Foundation
> http://forum.kodujdlapolski.pl
> krzysztof.madejski at epf.org.pl
> +48 664 082 823
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150203/fb5b0042/attachment-0003.html>


More information about the ckan-dev mailing list