Session Temp Files

  • Tags: file upload
  • Latest: 1.0
  • Last Updated: 07 September 2009
  • Grails version: 1.1 > *
  • Authors: fletcherr
0 vote
Dependency:
compile ":session-temp-files:1.0"

 Documentation

Summary

Installation

grails install-plugin session-temp-files

Description

Session Temp Files Plugin

The 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 Methods

The 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 java.io.File.createTempDir

Change Log

1.0

Initial version.

Contact

Source code for the plugin is hosted on GitHub. Please send any questions or suggestions to rob@energizedwork.com.