Closed SpechtD closed 1 year ago
Hey, I think getDirectDownload() is not what you are looking for.
To directly download a file as authenticated user: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#downloading-files
A custom storage implementation can return an url for direct download of a give file.
The idea is/was that a storage implementation (e.g. S3) provide a link (including an access token) to directly download a file from a remote storage.
Till now I have used this, but from the frontend.: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#direct-download Now I need to generate the URL in the backend, so I tried using the PHP API.
https://github.com/nextcloud/server/blob/master/apps/dav/lib/Controller/DirectController.php
I guess you need to copy the above logic for now.
cc @skjnldsv @icewind1991 do you know if we have a php api to generate a direct download link?
I guess it just was forgotten at some point https://github.com/nextcloud/server/blob/459202d54cf891298099c3f793d2b163b9b76541/lib/private/Files/Storage/Common.php#L516-L518
So probably it make sense to implement the method in the Local or Root with the logic from the dav app.
Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!
⚠️ This issue respects the following points: ⚠️
Bug description
IStorage::getDirectDownload() always returns an empty array in the code under Steps to reproduce.
Steps to reproduce
Expected behavior
Return a URL for direct download of a given file.
Installation method
Manual installation
Operating system
Other
PHP engine version
PHP 7.4
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
No response
What user-backends are you using?
Configuration report
No response
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response