When an web applicatino allows upload of files to file system without checking extension,type , contents ,size , then an attacker can upload dangerous files. The files could be server side code(.php/.jsp) , a backdoor, webshell  or client side executable. 

How to ensure file uploads are safe?