Upload the file against a FileID , file name is changed

Hi Team, I have an problem statement
Step 1 download the file from nextcloud encrypt this against the file ID as a encryption key.

Step 2 Upload this file ( encrypted file name is change with the additonal extension say a.pdf-> a.pdf.secure ) now i want to upload this against the same id, as i want this static Id attached to file , always .even if filename is changed? is it possible ?

or can i assume username/filename would always unique , and build some logic around this instead of file id

Hello. I am unsure if this is actually a development question. Depends abit on the scope as I am unsure what the key points of the topic are.

Do you want to encrypt on the server or the client? The other post does state nothing about encryption.

Long story short: The id of a file is chosen once the file is created/detected by the NC core for normal storage backends (the default). Other backends might have different behavior, though.
If you wanted to preserve the file id, I guess (but this needs checking!) it would be sufficient to rename the file and replace its content.

However, one word of warning: When it comes to encryption and security, you should know what you are doing… Otherwise you might just open an immense hole in your security shield without notice. Just ne sure to think through what you are doing.

Christian

There is a client-side encryption in the Nextcloud client. There are other 3rd party solutions (cryptomator and others). Just in case, you wanted to implement encryption yourself.

I don’t really understand what the benefit of this is, the fileID is not very secret. There is the server-side encryption that does encrypt files with keyfiles that are on your server (secured by the user’s password), but it protects files stored on external storage (they don’t have the key file).