public boolean SaveFiles(String path) {

        boolean res = true;

        for (MultipartFile mpf : files) {
            BufferedOutputStream bufferedOutputStream = null;
            try {
                bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(path + mpf.getOriginalFilename()));
                InputStream inputStream = new ByteArrayInputStream(mpf.getBytes());
                int token = -1;

                while ((token = inputStream.read()) != -1) {
                    bufferedOutputStream.write(token);
                }
                bufferedOutputStream.flush();
                bufferedOutputStream.close();
                inputStream.close();

            } catch (FileNotFoundException e) {
                errorMsg += e.getMessage();
                res = false;
            } catch (IOException e) {
                errorMsg += e.getMessage();
                res = false;

            }
        }

        return res;
    }