Need to save file twice to trigger exception
Related to #9197 In order to prevent the generation of empty metaData/content file, the system should trigger an exception if CONTENTALLOWZEROLENGTHFILES=false. Currently, the first time the file is saved, there’s not exception in the logs. You need to save the file twice to trigger the exception.
Steps to reproduce:
- Login to dotcms
- Upload a .txt file which size is than 0
- Open the .txt file and edit the content. Delete all data so the size now is 0
Before:
After:

- Hit Save or Save/Publish
- You will see the file was successfully saved containing 0 bytes
- You need to hit Save or Save/Publish twice to trigger the exception:

Tested locally in: master-3.6 // Win7 Pro SP1 // SQLServer 2012 // Firefox master-3.6 // Mac OS 10.10 // MySQL 5.6.23 // Chrome
For this to also throw the exception we need to include the validations in #9197 in the moveFile method as well
PR: https://github.com/dotCMS/core/pull/9331. Tested with the property set to true, so files with 0 bytes upload without throwing the exception.
I believe this is already documented here: http://auth.dotcms.com/docs/latest/file-configuration - but let me know if there is something I am missing
Passed QA. Exception is being triggered the first time Tested locally in: master-3.6 // Mac OS 10.10 // MySQL 5.6.23 // Firefox v45.0.1