module UploadService

Defined in:

services/upload_service.cr

Constant Summary

Log = ::Log.for(self)

Class Method Summary

Class Method Detail

def self.authorize(file_path : String, actor_id : Int64) : Bool #

Validates that an actor owns a specific upload.


[View source]
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.


[View source]
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.


[View source]