class FileUploader

This class implements a file uploader service.

This service is defined in config/packages/g6k.yml as follows:

g6k.file_uploader: class: App\G6K\Services\FileUploader arguments: ['%upload_directory%']

Properties

private string $uploadDir

Methods

void
__construct(string $uploadDir)

Constructor of class FileUploader

string
upload(UploadedFile $file)

Moves the file to the upload directory with a temporary file name.

Details

at line 61
void __construct(string $uploadDir)

Constructor of class FileUploader

Parameters

string $uploadDir The upload directory

Return Value

void

at line 73
string upload(UploadedFile $file)

Moves the file to the upload directory with a temporary file name.

Parameters

UploadedFile $file The file uploaded through a form.

Return Value

string The temporary file name