module Latch::UploadedFile

Overview

Interface for uploaded file objects. Include this module in your framework's uploaded file class to make it compatible with Latch.

Only #tempfile and #filename are required. The other methods have sensible defaults that can be overridden.

struct MyUploadedFile
  include Latch::UploadedFile

  getter tempfile : File
  getter filename : String

  def initialize(@tempfile, @filename)
  end
end

Direct including types

Defined in:

latch/uploaded_file.cr

Instance Method Summary

Instance Method Detail

def content_type : String | Nil #

[View source]
abstract def filename : String #

[View source]
def path : String #

[View source]
def size : UInt64 #

[View source]
abstract def tempfile : File #

[View source]