No. Renaming a file doesn't increase security.
He says to me, that by making all files images no harm can be done to the server.
for example evilscript.evil would become evilscript.png
When you rename evilscript.evil
to evilscript.png
you don't turn it into an image. You just change its name. Generally, a file name isn't relevant. It is just a name given to a block of data, nothing more.
If you can execute an uploaded script, you probably can do it regardless of its name. If you cannot, uploading a malicious script doesn't harm the system, since the script won't be executed anyway.
However, it can prevent a file from being accidentally run. The only protection renaming could provide is the protection from being accidentally launched by Windows explorer (or a shell that similarly uses file extensions). So renaming virus.exe
into virus.exe~
actually helps, when you accidentally tap Enter on it.
Unix shells use file formats instead of extensions. As an example, you can save a script as evilscript.png
and run it with a Linux shell, providing the file has the "execute" permission. In terms of security, generally it is better to control file permissions instead of file names.