This commit is contained in:
gulnaz 2024-10-01 15:53:30 +03:00
parent 23103aa3b9
commit 6c9ecf7458

View file

@ -89,6 +89,14 @@ public class FileUploadService {
try {
FileUrl fileUrl = parseFileUrl(downloadRequest.fileInfo().getFileUrl());
try {
Files.createDirectories(Paths.get(fileSavingPath));
}
catch (IOException e) {
throw new RuntimeException("Failed to create directory " + fileSavingPath, e);
}
logger.info("working in {}", System.getProperty("user.home"));
Path filePath = Paths.get(fileSavingPath, fileUrl.fileName());
String downloadUrl = fileUrl.fileUrl();
downloadFile(downloadUrl, filePath);