grails install-plugin session-temp-files
Session Temp Files PluginThe Session Temp Files Plugin allows an application to store temporary files bound to a user's session that will be automatically cleaned up when the session expires or is destroyed for any other reason. This can be useful for storing uploaded files during validation before moving them to permanent storage, for example. Even if the user closes the browser or otherwise exits a workflow in a way the application does not handle the files will get cleaned up when the session expires.
Dynamic MethodsThe plugin binds the following additional methods to the HTTPSession class.
getTempDir()Returns the temp directory bound to the session creating it if it does not currently exist.
createTempFile(prefix, suffix)Creates and returns a new temporary file in the session's temp directory. The prefix and suffix arguments are as per