[ckan-dev] Uploading files via API - UR: Missing value error
Krzysztof Madejski
krzysztof.madejski at epf.org.pl
Tue Feb 3 15:01:02 UTC 2015
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150203/76eb7f1d/attachment-0002.html>
More information about the ckan-dev
mailing list