#1
I added an upload file method to my project with files stored in the module.

I had to make changes to the upload_file method in Trongate.php because it only stores in the public folder, not the module.

I'm concerned that it will be overwritten in future updates.

What do you suggest to prevent this?

Based on the upload_picture method, here are the changes I made...

Here are my module settings for uploading a file, notice upload_to_module = true.


I pass this value to the upload_file method.


In the upload_file method in Trongate.php, I added a check for the upload_to_module value.


Further in the upload_file method in Trongate.php, I set the $target_destination to the module path if upload_to_module is true.
#2
Hello,
Any code that you change in the engine folder when updated will overwrite you code.
I would make a file that has the changes that you make documenting the process of the changes.
That way you will have them with the app.
It sounds like the trongate.php file is the only engine folder file you change. Maybe a view file?
If a change happens then just compare your changes with the updated trongate.php file.
Should not happen very often. And you do not have to update if you do not want to.
Everything should still work.
Dan
#3
Thanks Dan. Yes, Trongate.php is the only core file I changed so I will make a backup copy of my changes.