Save With Full Path at Amazon S3

Hi,

is there anyway to configure Amazon S3 as a primary storage, but the files at the S3 would have a readable full path? for example, at my local folder I had a file saved as /test_user/PDFs/manual.pdf so i can find it at S3 with the same path.

the S3 is already configured and linked to the NextCloud, but all files are in the form of urn:oid:1158, and I have NectCloud 12.0.4.3

so is there anyway to configure the S3 bucket to save the files in their full path? Keep in mind i have multiple users, so beside the path, its required to know the user too

Thanks

As far as I understand that’s not how it works. I understand what you’re asking for but think it would require a rewrite of that code.

What are you trying to achieve, if it’s to be able to find user’s files, why not use the impersonate plugin (limit to your user or admin group) then you can effectively logon as different users and see their files etc.

it seems that your understanding is correct, files I tired to upload files and in the S3 I found files with the weird format urn:oid having modification date same as uploading date, also the file has the same size, that means its the same file

what I want to do, I already have an app that contains web hooks for files events, and returns the modification date and size, and sends data as a request, that works fine before linking the S3 to the NextCloud server, but after linking the S3 as the primary storage with this format I don’t know if I have the path and the user, how can I retrieve the file

Thanks for your response :slight_smile:

Had a quick play in the database and not had a chance to read through the code (which I may or may not understand :grin:) so the following is based on that caveat!

For my test I created a directory test in the root for a given user, created a subdirectory within that called test 2 and then within that created a file test.txt.

  1. the oc_filecache table lists all the files in the S3 bucket and the number in the name (eg url:oid:474) is the file_id field.

  2. each file has a parent which will be the parent path, so in my case I can see

So I can trace through parent and see entry 215 the path of which is shown as files (top level) and the parent is 199

That ultimate parent I can lookup to root_id in oc_mounts which identifies the user.

Don’t know as I say whether going through the code would give a simpler way to find the owner etc but that seems to work!

Hi were you able to find a way to create a user friendly view in S3
I cant see any of my folders or files all r converted to this urn:oid,

When i even download the file it is downloaded as dms file which i have no idea how to convert to normal file