public String save ( String uploadFolder ) throws ControllerException { String realPath = info . getRealPath ( uploadFolder ) ; fn . sanitise ( ) ; String imagename = uniqueImagename ( realPath , fn . fullPath ( ) ) ; try { ImageIO . write ( image , fn . extension ( ) , new File ( realPath , imagename ) ) ; image . flush ( ) ; } catch ( IOException e ) { throw new ControllerException ( e ) ; } return uploadFolder + File . separatorChar + imagename ; }
Saves the file on the server in the folder given