protected String createFormFieldName ( BinaryAttachment binaryAttachment ) { if ( binaryAttachment . getFieldName ( ) != null ) { return binaryAttachment . getFieldName ( ) ; } String name = binaryAttachment . getFilename ( ) ; int fileExtensionIndex = name . lastIndexOf ( ' ' ) ; return fileExtensionIndex > 0 ? name . substring ( 0 , fileExtensionIndex ) : name ; }
Creates the form field name for the binary attachment filename by stripping off the file extension - for example the filename test . png would return test .