public boolean saveFilesToDisk(String path) {

        for (MultipartFile mpf : files) {
            try {

                errorMsg += "\nFile saved to: " + path;
                File dest = new File(path, mpf.getOriginalFilename());
                if (!dest.exists()) {
                    dest.mkdirs();
                }
                mpf.transferTo(dest);
                errorMsg += "File name: " + dest;

            } catch (IllegalStateException e) {
                errorMsg += "File uploaded failed:" + e.getMessage();
                return false;
            } catch (IOException e) {
                errorMsg += "File uploaded failed:" + e.getMessage();
                return false;
            }
        }

        return true;
    }