diff --git a/src/main/java/gwt/material/design/addins/client/fileuploader/MaterialFileUploader.java b/src/main/java/gwt/material/design/addins/client/fileuploader/MaterialFileUploader.java index 95021b2f1..27030c989 100644 --- a/src/main/java/gwt/material/design/addins/client/fileuploader/MaterialFileUploader.java +++ b/src/main/java/gwt/material/design/addins/client/fileuploader/MaterialFileUploader.java @@ -251,18 +251,18 @@ protected void initDropzone(Element e, Element template, String previews, Elemen code = file.xhr.status; } - if (response.indexOf("401") >= 0) { + if (code.equals("401")) { response = "Unauthorized. Your session may have expired. Log in and try again."; globalResponse = response; UnauthorizedEvent.fire(this, convertUploadFile(file), new UploadResponse(file.xhr.status, file.xhr.statusText, response)); } - if (response.indexOf("404") >= 0) { + if (code.equals("404")) { response = "There is a problem uploading your file."; globalResponse = response; } - if (response.indexOf("500") >= 0) { + if (code.equals("500")) { response = "There is a problem uploading your file."; globalResponse = response; } @@ -749,4 +749,4 @@ public void onMaxFilesExceeded(MaxFilesExceededEvent event) { } }, MaxFilesExceededEvent.getType()); } -} \ No newline at end of file +}