Class FileStorageService

java.lang.Object
springboot.bg.harisauto.common.service.FileStorageService

@Service public class FileStorageService extends Object
FileStorageService.java - Service class for handling file uploads locally.
Author:
Kristian Popov
  • Constructor Details

    • FileStorageService

      public FileStorageService()
  • Method Details

    • storeFile

      public String storeFile(org.springframework.web.multipart.MultipartFile file, String subDir)
      Stores a file in the local file system.
      Parameters:
      file - the MultipartFile to save.
      subDir - the subdirectory within 'uploads/'.
      Returns:
      the relative URL path to access the file (e.g., /uploads/news/filename.jpg)