Generating file documents with zero bytes

Dear Experts,    I'm facing an issue in generating the file document in mendix. Sometime the files are generating properly and sometimes it's generating with zero bytes.    Here after the generate document activity I'm using download activity and trying to show the generated document on UI in a new tab. It's searching for a file which is generated and trying to preview in an new tab but due to zero bytes it's showing error as the file I'd is not present.    Not sure why this is happening. Kindly let me know what went wrong.    NOTE ; THIS IS NOT HAPPENING IN LOCAL BUT ONLY ON CLOUD. DEPLOYMENT METHOD IS ON PREMISES. FILES WILL BE STORED ON FILE SERVER.    Answers are really much appreciated. 
1 answers

you can enable debugging in server and check whether your file is really store in file server yet 


m2ee(): enable_debugger 


m2ee(): show_debugger_status