[ckan-dev] Create a file upload field for organization
Nigel Babu
nigel.babu at okfn.org
Mon Oct 27 04:42:16 UTC 2014
This probably not possible right now. You would need to change a couple of
things in the form and the controller.
a) Add enctype=multipart/form-data to the form definition.
b) Handle the upload in the controller with the Upload class in
ckan/lib/upload.py.
There hasn't yet been work done to make this generally available for custom
forms.
Nigel Babu
Senior Sysadmin, Open Knowledge
On 27 October 2014 04:25, <Qifeng.Bai at csiro.au> wrote:
> Hi, there
>
>
>
> I would like to create a field for organization which is able to upload a
> file or a link. It is similar with ‘image’ field of ‘organization’. I have
> tried to create a field by using form.image_upload macro provided by CKAN.
>
> It can select a file, but it won’t upload this file and the value of this
> field is ‘FieldStorage(‘filename’)’. Is there anyone can tell me how CKAN
> deal with ‘form.image_upload’ inside, please
>
>
>
> Cheers
>
>
>
>
>
>
>
> [image: cid:image001.gif at 01CC55BF.85E7FEB0]
>
> Qifeng Bai
> Software Engineer
> CSIRO Land and Water
> Black Mountain, Canberra
>
> Ph: +61-2-62465704
> Web: www.clw.csiro.au
>
>
>
>
>
> _______________________________________________
> 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/20141027/4b8bb587/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 2094 bytes
Desc: not available
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20141027/4b8bb587/attachment-0003.gif>
More information about the ckan-dev
mailing list