Skip to content

Instantly share code, notes, and snippets.

@fatihkurcenli
Created February 7, 2022 12:26
Show Gist options
  • Save fatihkurcenli/af961e0dc08c6ce7a9721abefb7d869c to your computer and use it in GitHub Desktop.
Save fatihkurcenli/af961e0dc08c6ce7a9721abefb7d869c to your computer and use it in GitHub Desktop.
FileUploadService
@Service
@Component
class FileUploadService {
fun uploadFileLocal(file: MultipartFile): Boolean {
return file.contentType?.let {
if (it.contains("mp4")) {
file.transferTo(File("C:\\xampp\\htdocs\\hls-server\\input\\" + file.originalFilename))
val refactorVideoClass = RefactorVideoClass(file.originalFilename)
refactorVideoClass.start()
true
} else {
false
}
} ?: false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment