Search code examples
file-uploadliferayliferay-hook

liferay process files which are uploaded


I'm new to Liferay, and I need to create hook which will intercept file and process it before save to the filesystem. Is it possible to do with hooks or I need to make ext?


Solution

  • I'd expect this to work in a hook. Create a hook that intercepts DLFileEntryLocalService, e.g. addFileEntry. Do your job in that method and if you want to approve this to be added to the database, call super.addFileEntry(...) which will take care of the default behaviour.

    You'll have to identify if there are more methods that can add a document to the library.