Edit or change user file from the self hosted server

I had hosted nextcloud in my server and my users will upload the “.csv” files then I will work on the file after that I will write the results back to the same directory with the same filename so file gets overridden.
This is what I want but there is a problem when the user downloads the file only a few rows will be available the downloaded file and when I check the file in the backend I am able to understand that the file is good. The only issue is when the file is downloaded from the frontend by the user.