bug fix
This commit is contained in:
parent
d040e5a4e1
commit
bd59a5b228
2 changed files with 2 additions and 3 deletions
|
|
@ -125,7 +125,7 @@ public abstract class AjaxFileUpload extends HttpServlet {
|
||||||
String[] tmp = config.getInitParameter("ALLOWED_EXTENSIONS").split(",");
|
String[] tmp = config.getInitParameter("ALLOWED_EXTENSIONS").split(",");
|
||||||
StringBuilder ext_log = new StringBuilder("Allowed extensions: ");
|
StringBuilder ext_log = new StringBuilder("Allowed extensions: ");
|
||||||
for( String ext : tmp ){
|
for( String ext : tmp ){
|
||||||
ALLOWED_EXTENSIONS.add(ext.trim());
|
ALLOWED_EXTENSIONS.add(ext.trim().toLowerCase());
|
||||||
ext_log.append(ext).append(", ");
|
ext_log.append(ext).append(", ");
|
||||||
}
|
}
|
||||||
logger.info( ext_log.toString() );
|
logger.info( ext_log.toString() );
|
||||||
|
|
@ -215,7 +215,7 @@ public abstract class AjaxFileUpload extends HttpServlet {
|
||||||
while( it.hasNext() ) {
|
while( it.hasNext() ) {
|
||||||
FileItemStream item = it.next();
|
FileItemStream item = it.next();
|
||||||
// Is the file type allowed?
|
// Is the file type allowed?
|
||||||
if( !item.isFormField() && !ALLOWED_EXTENSIONS.contains( FileUtil.getFileExtension(item.getName()) )){
|
if( !item.isFormField() && !ALLOWED_EXTENSIONS.contains( FileUtil.getFileExtension(item.getName()).toLowerCase() )){
|
||||||
String msg = "Filetype '"+FileUtil.getFileExtension(item.getName())+"' is not allowed!";
|
String msg = "Filetype '"+FileUtil.getFileExtension(item.getName())+"' is not allowed!";
|
||||||
logger.warning( msg );
|
logger.warning( msg );
|
||||||
listener.setStatus(Status.Error);
|
listener.setStatus(Status.Error);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ import zutil.parser.DataNode.DataType;
|
||||||
* uploaded file.
|
* uploaded file.
|
||||||
*/
|
*/
|
||||||
public class FileUploadListener implements ProgressListener{
|
public class FileUploadListener implements ProgressListener{
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
public static enum Status{
|
public static enum Status{
|
||||||
Initializing,
|
Initializing,
|
||||||
Uploading,
|
Uploading,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue