No description
Find a file
github-actions[bot] 3476f6a2f8
Merge pull request #754 from nextcloud/automated/noid/master-update-nextcloud-ocp
[master] Update nextcloud/ocp dependency
2026-03-22 04:48:42 +00:00
.github feat(deps): Add Nextcloud 34 support 2026-02-10 10:47:02 +00:00
.tx [tx-robot] Update transifex configuration 2022-10-01 02:27:37 +00:00
appinfo feat(deps): Add Nextcloud 34 support 2026-02-10 10:47:02 +00:00
css chore(assets): Recompile assets 2025-10-28 08:24:27 +00:00
js chore(assets): Recompile assets 2026-03-06 16:49:37 +01:00
l10n fix(l10n): Update translations from Transifex 2026-02-24 00:45:13 +00:00
lib docs: Add Override attribute 2026-02-10 11:10:55 +01:00
LICENSES docs: add missing license 2026-02-10 11:38:35 +01:00
src fix: don't apply limit if it's disabled 2026-03-06 16:49:35 +01:00
templates chore: Add SPDX header 2024-08-05 16:53:35 +02:00
tests chore: make psalm pass again 2025-07-07 18:24:25 +02:00
vendor-bin/psalm ci: Update psalm 2026-02-10 11:10:54 +01:00
.gitattributes chore: Add SPDX header 2024-08-05 16:53:35 +02:00
.gitignore chore: Add SPDX header 2024-08-05 16:53:35 +02:00
.l10nignore chore: Add SPDX header 2024-08-05 16:53:35 +02:00
.php-cs-fixer.dist.php chore: Add SPDX header 2024-08-05 16:53:35 +02:00
AUTHORS.md chore: Make app REUSE compliant 2024-08-07 14:16:57 +02:00
composer.json chore(dev-deps): Bump nextcloud/ocp package 2026-02-15 03:15:45 +00:00
composer.lock chore(dev-deps): Bump nextcloud/ocp package 2026-03-22 03:15:09 +00:00
eslint.config.js refactor: migrate to Vue 3 2025-09-26 09:13:32 +02:00
LICENSE Initial commit 2021-09-08 19:52:33 +02:00
Makefile chore: Add SPDX header 2024-08-05 16:53:35 +02:00
package-lock.json feat(deps): Add Nextcloud 34 support 2026-02-10 10:47:02 +00:00
package.json feat(deps): Add Nextcloud 34 support 2026-02-10 10:47:02 +00:00
psalm.xml chore: make psalm pass again 2025-07-07 18:24:25 +02:00
README.md docs: Add REUSE status badge 2024-08-07 15:47:33 +02:00
REUSE.toml chore: make psalm pass again 2025-07-07 18:24:25 +02:00
tsconfig.json refactor: apply new ESLint rules 2025-07-09 16:19:34 +02:00
vite.config.ts refactor: apply new ESLint rules 2025-07-09 16:19:34 +02:00

Files download limit

REUSE status Node GitHub Action Lint GitHub Action

This app allows limiting the number of downloads for external link shares.


API

The examples below can be run using hurl.

Tip

To ignore assertions pass the --ignore-asserts flag.

External share limit

An external share limit may be queried by its token.

Get

hurl get.hurl --variable token='2Nyq27RKT7Jw9q3'

get.hurl

GET https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit

OCS-APIRequest: true
Accept: application/json

[BasicAuth]
alice: alice

HTTP 200
[Asserts]
jsonpath "$.ocs.data.limit" exists
jsonpath "$.ocs.data.count" exists

PropFind

hurl propfind.hurl --variable owner=admin --variable path=/welcome.txt

propfind.hurl

PROPFIND https://nextcloud.local/remote.php/dav/files/{{owner}}/{{path}}

[BasicAuth]
{{owner}}: {{owner}}

```xml
<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
	<d:prop>
		<oc:fileid />
		<d:displayname />
		<d:getlastmodified />
		<d:getcontenttype />
		<oc:size />
		<oc:owner-id />
		<oc:share-types />
		<nc:sharees />
		<nc:share-download-limits />
	</d:prop>
</d:propfind>
```

HTTP 207
[Asserts]
xpath "//nc:share-download-limits" isCollection

Set

hurl set.hurl --variable token='2Nyq27RKT7Jw9q3' --variable limit=5

set.hurl

PUT https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit

OCS-APIRequest: true
Accept: application/json

[BasicAuth]
alice: alice

{
	"limit": {{limit}}
}

HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty

Remove

hurl remove.hurl --variable token='2Nyq27RKT7Jw9q3'

remove.hurl

DELETE https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit

OCS-APIRequest: true
Accept: application/json

[BasicAuth]
alice: alice

HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty

Default limit

Admins may set a default limit.

hurl set-default.hurl --variable limit=1

set-default.hurl

PUT https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/limit

OCS-APIRequest: true
Accept: application/json

[BasicAuth]
admin: admin

{
    "limit": {{limit}}
}

HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty