From c4fde5327406280c845e298f954aab87d9160ae1 Mon Sep 17 00:00:00 2001
From: N S Deepika Singh <110279487+deepikaSingh2711@users.noreply.github.com>
Date: Tue, 27 Jan 2026 15:51:19 +0530
Subject: [PATCH 1/2] Support Attachment size restriction during upload
---
README.md | 20 ++++++++++++++++++++
sdm/pom.xml | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0316d8cf..cab36e23 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ This plugin can be consumed by the CAP application deployed on BTP to store thei
- Display attachments specific to repository: Lists attachments contained in the repository that is configured with the CAP application.
- Custom properties : Provides the capability to define custom properties for attachments.
- Maximum allowed uploads: Provides the capability to define the maximum number of uploads allowed for the user.
+- Maximum file size: Provides the capability to specify the maximum file size for attachments.
- Multiple attachment facets: Provides the capability to define multiple attachment facets/sections in the CAP Entity.
- Technical user support: Provides the capability to consume the plugin using technical user.
- Copy attachments: Provides the capability to copy attachments from one entity to another entity.
@@ -34,6 +35,7 @@ This plugin can be consumed by the CAP application deployed on BTP to store thei
- [Support for Multitenancy](#support-for-multitenancy)
- [Support for Custom Properties](#support-for-custom-properties)
- [Support for Maximum allowed uploads](#support-for-maximum-allowed-uploads)
+- [Support for Maximum File Size](#support-for-maximum-file-size)
- [Support for Multiple attachment facets](#support-for-multiple-attachment-facets)
- [Support for Technical user](#support-for-technical-user)
- [Support for Copy attachments](#support-for-copy-attachments)
@@ -492,6 +494,24 @@ SDM.maxCountErrorMessage = Maximale Anzahl von Anhängen erreicht
>
> Once the maxCount is configured, it is recommended not to alter it. If the maxCount is altered, the previously uploaded documents will still be visible.
+## Support for Maximum File Size
+
+This plugin allows you to specify the maximum file size for attachments by using the `@Validation.Maximum` annotation on the attachments content property. When a user attempts to upload a file that exceeds the defined limit, the upload will be rejected with "AttachmentSizeExceeded" error.
+
+Refer the following example from a sample Bookshop app:
+
+```cds
+
+entity Books {
+ ...
+ attachments: Composition of many Attachments;
+}
+
+annotate Books.attachments with {
+ content @Validation.Maximum : '200MB';
+}
+```
+
## Support for Multiple attachment facets
The plugin supports creating multiple attachment facets or sections, each allowing various documents to be uploaded. The names of these facets are fully customizable. All existing operations available for the default attachment facet are also supported for any additional facets you create.
diff --git a/sdm/pom.xml b/sdm/pom.xml
index 7acda979..ab91d26e 100644
--- a/sdm/pom.xml
+++ b/sdm/pom.xml
@@ -34,7 +34,7 @@
src/test/gen
17
17
- 1.2.4
+ 1.3.0
1.18.36
0.8.7
3.10.8
From f3cfc89931b15b71ce137101ad020a86804d45f4 Mon Sep 17 00:00:00 2001
From: Deepika Singh NS <110279487+deepikaSingh2711@users.noreply.github.com>
Date: Tue, 27 Jan 2026 16:54:35 +0530
Subject: [PATCH 2/2] Update README.md
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index cab36e23..32130233 100644
--- a/README.md
+++ b/README.md
@@ -511,6 +511,7 @@ annotate Books.attachments with {
content @Validation.Maximum : '200MB';
}
```
+Supports both decimal (KB, MB, GB, TB) and binary (KiB, MiB, GiB, TiB) units with comprehensive validation and error handling.
## Support for Multiple attachment facets
The plugin supports creating multiple attachment facets or sections, each allowing various documents to be uploaded. The names of these facets are fully customizable. All existing operations available for the default attachment facet are also supported for any additional facets you create.
@@ -1336,4 +1337,4 @@ We as members, contributors, and leaders pledge to make participation in our com
## Licensing
-Copyright 2024 SAP SE or an SAP affiliate company and contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-java/sdm).
\ No newline at end of file
+Copyright 2024 SAP SE or an SAP affiliate company and contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-java/sdm).