class Athena::MIME::Part::File

Overview

An abstraction that allows representing a file without needing to keep the file open.

Defined in:

part/file.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path : String | Path, filename : String | Nil = nil) #

[View source]

Instance Method Detail

def content_type : String #

Attempts to guess the content type of the file based on its path. Falls back to application/octet-stream.


[View source]
def filename : String #

Returns the name of the file, inferring it based on the basename of its path if not provided explicitly.


[View source]
def path : String #

Returns the path to the file on the filesystem.


[View source]
def size : Int #

Returns the size of the file in bytes.


[View source]