Foros de discusión

FileEntry 0 bytes

thumbnail
Rocco Piliero, modificado hace 7 años.

FileEntry 0 bytes

New Member Mensajes: 7 Fecha de incorporación: 12/11/16 Mensajes recientes
Hi,
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:
                FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folderUser.getRepositoryId(),
                        folderUser.getFolderId(), file.getFileName(), file.getContentType(), file.getFileName(), description,
                        changelog, fileTmp, serviceContextFiles);

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