LPS-47852

I have rewritten previous pull: https://github.com/sergiogonzalez/liferay-portal/pull/1623 in order to rebase after LPS-49619:
  - File extension validation can be removed, because LPS-49619 create new restrictions while using new "filename" attribute: https://github.com/jorgediaz-lr/liferay-portal/commit/763ba5f5857e3ba3b48f13fe65e6921575fa5109
  - Added missing JUnit test from LPS-24049: https://github.com/jorgediaz-lr/liferay-portal/commit/16c139da693c97302dbd2461f6deddc6f12c7668
  - CheckDuplicateTitles process is necessary in order to remove duplicated records created before the change and it will be also necesary for LPS-49767 issue
 
Previous code https://github.com/sergiogonzalez/liferay-portal/pull/1623 must be commited at 6.2.x branch because LPS-49619 cannot be backported