title: Liferay FileEntry 0 bytes
body: <p>I'm using liferay 6.2 portal ga4 and I have a problem with files added programmatically in document library. When I read a file from tomcat temp folder and save it in document library, sometimes it's correct and sometimes it becomes a zero bytes file.
  I upload the file with a jquery script and every time the file uploaded in tomcat temp has the right dimensions. Once I uploaded it in temporary folder, I add it in Document Library in this way:</p>
  
  <pre><code>FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folderUser.getRepositoryId(),
                 folderUser.getFolderId(), file.getFileName(), file.getContentType(), file.getFileName(), description,changelog, fileTmp, serviceContextFiles);
  </code></pre>
  
  <p>The statements completes with no error and logs are ok too, but sometimes the fileEntry I have created has 0 bytes instead that the right dimension.
  Can someone help me?
  Thank you,
  smxworld</p>