How to upload from CKAN package form #6434
Unanswered
brianacowles
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 👋, sorry if this question has been asked before, but I'm having some trouble finding answers online. I'm trying to add an upload field (similar to the one on the group form or add resource page) to the package form to support package thumbnails. I have:
package_basic_fields.html
file in templates:This actually allowed me to set urls as the thumbnail successfully, but I can't figure out how implement the upload functionality. I essentially want to call the same code used for the group thumbnails and store the image in the CKAN filestore. I've confirmed that filestore is configured correctly.
So far, I've tried to call the Filestore API from some javascript code (this fails as I can't find a way to obtain the package_id to send the API). I also tried calling the API from my
plugin.py
file in an implementation of thevalidate()
method from IDataSetForm. This 1. doesn't seem like the proper place to do that and 2. doesn't let me access the uploaded file to send to the API anyway.If possible, I'd ideally like to mimic the group upload functionality, but I can't tell how the upload code is called from the group page. I'd really appreciate any advice on how to go about this. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions