You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support uploading NetCDF (.nc) files as documents #14588
I would like to upload NetCDF (.nc) files to GeoNode as documents, so users can catalogue, manage permissions, and download the original files. GeoServer publishing or map visualization is not required.
Current behavior
In my current checkout (GeoNode 5.1.0 dev), .nc is not included in DOCUMENT_TYPE_MAP. Adding nc to ALLOWED_DOCUMENT_TYPES alone does not enable it because the setting is filtered against that map. Uploads also require content-type validation configuration.
Questions
Is excluding NetCDF from document uploads intentional, or is this simply a file type that has not yet been added? What is the recommended way to support it, including NetCDF classic and NetCDF-4/HDF5 files?
Expected behavior
Allow valid .nc files to be uploaded as documents.
Preserve the original file for download.
Use the existing document metadata and permission controls.
Require no spatial parsing or GeoServer publishing.
I also tried uploading a ZIP containing NetCDF files as a document, but that failed too.
Steps to reproduce
Open the document upload page (/catalogue/#/upload/document).
Upload scenario-results.zip (approximately 9.87 MiB), containing these files at the archive root:
cloud.nc
wind.nc
rain.nc
manifest.json
The upload task fails with:
A document must have a file or a url
What I found in the failed task
The action was document_upload, handled by DocumentFileHandler. The original temporary file parameters contained both base_file and zip_file, pointing to the uploaded ZIP. After preprocessing, the task's files contained only nc_file and json_file; base_file was missing.
In the code running in my deployment, BaseHandler.pre_processing() extracts archives whenever zip_file is present and rebuilds the file mapping through organize_files_by_ext(..., kind="document"). Since the extracted .nc and .json files are not allowed document main-file types in my configuration, no base_file is selected. BaseDocumentFileHandler.is_valid() then raises the error above.
Expected behavior
When uploading a ZIP as a document, I would expect GeoNode to retain the complete original archive as one downloadable document, while still applying the existing ZIP safety and size checks. I am not asking it to import or publish the enclosed NetCDF files as datasets.
Is this automatic extraction intended for document uploads, or should it be limited to archive-based dataset imports? This appears to be a separate ZIP document-upload issue in addition to the missing .nc document type support.
The document type, MIME, and magic-byte maps have no nc entry, and allowed document extensions are taken from the type map, so an allow-list entry alone never accepts the file. Content checks also have no NetCDF or HDF5 types to match against the file bytes.
nc is registered as an archive document with MIME type application/x-netcdf.
Activity
TheStarsBlink commentedon Sep 8, 2026
scenario-results.zip
I also tried uploading a ZIP containing NetCDF files as a document, but that failed too.
Steps to reproduce
/catalogue/#/upload/document).scenario-results.zip(approximately 9.87 MiB), containing these files at the archive root:What I found in the failed task
The action was
document_upload, handled byDocumentFileHandler. The original temporary file parameters contained bothbase_fileandzip_file, pointing to the uploaded ZIP. After preprocessing, the task'sfilescontained onlync_fileandjson_file;base_filewas missing.In the code running in my deployment,
BaseHandler.pre_processing()extracts archives wheneverzip_fileis present and rebuilds the file mapping throughorganize_files_by_ext(..., kind="document"). Since the extracted.ncand.jsonfiles are not allowed document main-file types in my configuration, nobase_fileis selected.BaseDocumentFileHandler.is_valid()then raises the error above.Expected behavior
When uploading a ZIP as a document, I would expect GeoNode to retain the complete original archive as one downloadable document, while still applying the existing ZIP safety and size checks. I am not asking it to import or publish the enclosed NetCDF files as datasets.
Is this automatic extraction intended for document uploads, or should it be limited to archive-based dataset imports? This appears to be a separate ZIP document-upload issue in addition to the missing
.ncdocument type support.mvanhorn commentedon Nov 14, 2026
The document type, MIME, and magic-byte maps have no nc entry, and allowed document extensions are taken from the type map, so an allow-list entry alone never accepts the file. Content checks also have no NetCDF or HDF5 types to match against the file bytes.
nc is registered as an archive document with MIME type application/x-netcdf.
#14767