Undefined consonant UPLOAD_DIRECTORY

I try to make a file input working by using the documentation:

and it gives the error

Use of undefined constant UPLOAD_DIRECTORY - assumed ‘UPLOAD_DIRECTORY’

I can understand that if ‘’ is assumed, this may explain the following error:

Argument 1 passed to Cake\Http\Session::_overwrite() must be of the type array, null given

I also assume the documentation is correct :slight_smile: although not explicetely mentioned, I used
use UploadedFileInterface; in the Controller that produces the error:

public function add()

    $gpxFile = $this->GpxFiles->newEmptyEntity();
    if ($this->request->is('post')) {
       $gpxFile = $this->GpxFiles->patchEntity($gpxFile, $this->request->getData());
		$gpx = $this->request->getData('gpx');
		$destination = UPLOAD_DIRECTORY . $gpxFile->user_id . $gpx->getClientFilename();

		// Existing files with the same name will be replaced.

Is this a real issue or something I overlooked / what is missing in the documentation?

My hunch is that UPLOAD_DIRECTORY is used in the documentation to indicate that it’s a constant that you need to supply somewhere.