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
### Files attached to a Dataset can now be limited by count
2
+
3
+
Added the ability to set a limit on the number of files that can be uploaded to a Dataset. Limits can be set globally through a JVM setting or set per Collection or Dataset.
4
+
5
+
See also [the guides](https://dataverse-guide--11359.org.readthedocs.build/en/11359/api/native-api.html#imposing-a-limit-to-the-number-of-files-allowed-to-be-uploaded-to-a-dataset), #11275, and #11359.
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/api/native-api.rst
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2474,7 +2474,7 @@ When adding a file to a dataset, you can optionally specify the following:
2474
2474
- Whether or not the file is restricted.
2475
2475
- Whether or not the file skips :doc:`tabular ingest </user/tabulardataingest/index>`. If the ``tabIngest`` parameter is not specified, it defaults to ``true``.
2476
2476
2477
-
Note that when a Dataverse installation is configured to use S3 storage with direct upload enabled, there is API support to send a file directly to S3. This is more complex and is described in the :doc:`/developers/s3-direct-upload-api` guide.
2477
+
Note that when a Dataverse installation is configured to use S3 storage with direct upload enabled, there is API support to send a file directly to S3. This is more complex and is described in the :doc:`/developers/s3-direct-upload-api` guide. Also, see :ref:`set-dataset-file-limit-api`, for limitations to the number of files allowed per Dataset.
2478
2478
2479
2479
In the curl example below, all of the above are specified but they are optional.
2480
2480
@@ -2699,6 +2699,58 @@ In some circumstances, it may be useful to move or copy files into Dataverse's s
2699
2699
Two API calls are available for this use case to add files to a dataset or to replace files that were already in the dataset.
2700
2700
These calls were developed as part of Dataverse's direct upload mechanism and are detailed in :doc:`/developers/s3-direct-upload-api`.
2701
2701
2702
+
Imposing a limit to the number of files allowed to be uploaded to a Dataset
Having thousands of files in a Dataset can cause issues. Most users would be better off with the data repackaged in fewer large bundles. To help curtail these issues, a limit can be set to prevent the number of file uploads from getting out of hand.
2706
+
2707
+
The limit can be set via JVM setting :ref:`dataverse.files.default-dataset-file-count-limit` to be installation wide, or, set on each Collection/Dataset.
2708
+
2709
+
For Installation wide limit, the limit can be set via JVM. ./asadmin $ASADMIN_OPTS create-jvm-options "-Ddataverse.files.default-dataset-file-count-limit=<limit>"
2710
+
2711
+
For Collections, the attribute can be controlled by calling the Create or Update Dataverse API and adding ``datasetFileCountLimit=500`` to the Json body.
2712
+
2713
+
For Datasets, the attribute can be set using the `Update Dataset Files Limit <#setting-the-files-count-limit-on-a-dataset>`_ API and passing the qp `fileCountLimit=500`.
2714
+
2715
+
Setting a value of -1 will clear the limit for that level. If no limit is found on the Dataset, the hierarchy of parent nodes will be checked until finally the JVM setting is checked.
2716
+
2717
+
With this setting set a 400 error response stating that the limit has been reached, including the effective limit, will be returned.
2718
+
2719
+
Please note that a superuser will be exempt from this rule.
2720
+
2721
+
The check will use the value defined in the Dataset first, and if not set (value <1) the Dataverse/Collection will be checked, and finally the JVM setting.
2722
+
2723
+
.. _set-dataset-file-limit-api:
2724
+
2725
+
Setting the files count limit on a Dataset
2726
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2727
+
In order to update the number of files allowed for a Dataset, without causing a Draft version of the Dataset being created, the following API can be used
2728
+
2729
+
.. note:: To clear the limit simply set the limit to -1 or call the DELETE API.
0 commit comments