Documentation

UploadableWidget

Uploadable Widget Trait Adds media library upload features to back-end widgets

Tags
author

Alexey Bobkov, Samuel Georges

Table of Contents

onUpload()  : void
Process file uploads submitted via AJAX
cleanFileName()  : string
Creates a slug form the string. A modified version of Str::slug with the main difference that it accepts @-signs
validateFileName()  : bool
Validate a proposed media item file name.
validateFileType()  : bool
Check for blocked / unsafe file extensions

Methods

onUpload()

Process file uploads submitted via AJAX

public onUpload() : void
Tags
throws
ApplicationException

If the file "file_data" wasn't detected in the request or if the file failed to pass validation / security checks

Return values
void

cleanFileName()

Creates a slug form the string. A modified version of Str::slug with the main difference that it accepts @-signs

protected cleanFileName(string $name) : string
Parameters
$name : string
Return values
string

validateFileName()

Validate a proposed media item file name.

protected validateFileName(mixed $name) : bool
Parameters
$name : mixed
Return values
bool

validateFileType()

Check for blocked / unsafe file extensions

protected validateFileType(mixed $name) : bool
Parameters
$name : mixed
Return values
bool

Search results