[PHP] How ? Simple nextcloud database interaction

Hi Nexcloud community,

i am still struggling to interact with the Nextcloud database.
My goal is to get a file that the user has uploaded to nexcloud over php.

In the normal way I have the sql interaction. But from the tutorials im confused with all the schema and the mapper and dao…

Is there any way to get a file from nextcloud database in a simple function?

App function:
Get Data from NextcloudDB, [Information.file] → php → has the data and use this information in frontend/dashboard/view

Hello.

Let me first fix a misunderstanding here: NC does not store the file in the database but on the hard disk. In the database, there is just a cache of all files plus some meta data for simpler handling.

If you only want to access files existing in the NC instance (the ones that you can see in the web frontend), then there is a PHP API available, that allows you to access/read/write/modify/delete/list/… these files and folders. The overall API docs conatins this in general but might be a bit hard to find. In the official docs, there is also a section about the file system.

If you combine both, you should be able to tackle your problem, I guess.

If the problem is clearer to me, I might give better advice. Hope, this is sufficient for now.

Christian

2 Likes