module UploadService
Defined in:
services/upload_service.crConstant Summary
-
Log =
::Log.for(self)
Class Method Summary
-
.authorize(file_path : String, actor_id : Int64) : Bool
Validates that an actor owns a specific upload.
-
.delete(path : String, actor_id : Int64, public_folder : String = Kemal.config.public_folder) : DeletionResult
Handles deleting a file.
-
.upload(file : File, filename : String, actor_id : Int64, public_folder : String = Kemal.config.public_folder, max_size : Int64 | Nil = 5242880, host : String = Ktistec.host) : UploadResult
Handles uploading a file.
Class Method Detail
def self.authorize(file_path : String, actor_id : Int64) : Bool
#
Validates that an actor owns a specific upload.
def self.delete(path : String, actor_id : Int64, public_folder : String = Kemal.config.public_folder) : DeletionResult
#
Handles deleting a file.
Removes the uploaded file and cleans up empty parent directories.
def self.upload(file : File, filename : String, actor_id : Int64, public_folder : String = Kemal.config.public_folder, max_size : Int64 | Nil = 5242880, host : String = Ktistec.host) : UploadResult
#
Handles uploading a file.
Orchestrates the entire upload process from validation through storage.