Api 1
Api 1
uri-path}")
private String baseUri;
// Ghi file
try (InputStream inputStream = file.getInputStream()) {
Files.copy(inputStream, filePath, StandardCopyOption.REPLACE_EXISTING);
}
if (!isValid) {
throw new StorageException("Invalid file format. Only " +
allowedExtensions.toString() + " are allowed.");
}
// Lưu tệp
String fileName = this.fileService.storeFile(file, folder);
return ResponseEntity.ok(new ResponseFileDTO(fileName, Instant.now()));
}