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

Krzysztof Madejski krzysztof.madejski at epf.org.pl
Wed Feb 4 15:13:30 UTC 2015


Now it works perfectly. Thanks!


On Tue, Feb 3, 2015 at 4:39 PM, Denis Zgonjanin <deniszgonjanin at gmail.com>
wrote:

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


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150204/afa63a9e/attachment-0003.html>


More information about the ckan-dev mailing list