class Lucky::UploadedFile

Overview

This class represents an uploaded file from a form

Defined in:

lucky/uploaded_file.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

blank? : Bool blank?, present? : Bool present?

Constructor Detail

def self.new(part : HTTP::FormData::Part) #

Creates an UploadedFile using a HTTP::FormData::Part.

The new file will be assigned the name of the provided HTTP::FormData::Part and the tempfile will be assigned the body of the HTTP::FormData::Part


[View source]

Instance Method Detail

def blank? : Bool #

Tests if the file name is blank, which typically means no file was selected at the time the form was submitted.

uploaded_file_object.blank? # => Bool

[View source]
def creation_time(*args, **options) #

[View source]
def creation_time(*args, **options, &) #

[View source]
def filename : String #

Returns the original name of the file

uploaded_file_object.filename # => String

[View source]
def metadata : HTTP::FormData::FileMetadata #

DEPRECATED #metadata deprecated. Each method on metadata is accessible directly on Lucky::UploadedFile


[View source]
def modification_time(*args, **options) #

[View source]
def modification_time(*args, **options, &) #

[View source]
def name(*args, **options) #

[View source]
def name(*args, **options, &) #

[View source]
def path : String #

Returns the path of the File as a String

uploaded_file_object.path # => String

[View source]
def read_time(*args, **options) #

[View source]
def read_time(*args, **options, &) #

[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def tempfile : File #

[View source]