Files as first-class citizens of CKAN. Upload, manage, remove files directly and attach them to datasets, resources, etc.
Read the documentation for a full user guide.
Also, check documentation of the file-keeper library. It's used by this extension and contains logic that does not depend on CKAN and may be useful if you are going to implement custom storage adapter or just want to use familiar file abstractions in the arbitrary program.
-
Install the extension
pip install ckanext-files
-
Add
files
to theckan.plugins
setting of the CKAN config file. -
Run DB migrations
ckan db upgrade -p files
-
Configure storage
ckanext.files.storage.default.type = files:fs ckanext.files.storage.default.path = /tmp/example ckanext.files.storage.default.create_path = true
-
Upload your first file
ckanapi action files_file_create upload@~/Downloads/file.txt`
Install dev
extras and nodeJS dependencies:
pip install -e '.[dev]'
npm ci
Run unittests:
pytest
Run frontend tests:
# start test server in separate terminal
make test-server
# run tests
npx cypress run
Run typecheck:
npx pyright