Previously it was at least possible to use public variable $this->file.
Now there is not way to retrieve full path at all.
If $this->file was removed from public access, you should add some getter, I guess.
oh, good catch!
I'm not sure that this property should be public in the next version though. What's the use-case for needing it?
My particular example is importing CSV file using http://csv.thephpleague.com/examples/ library (one of the most popular libraries for working with files).
I want to import CSV data without uploading file to S3 (I'm using stateless container-based architecture) using following code:
<?php
use League\Csv\Reader;
$csv = Reader::createFromPath($uploadedFile->getClientFileTmpName());
Where path should be tmp_path from UploadedFile object (which is not available now).
Previously I used it this way:
<?php
use League\Csv\Reader;
$csv = Reader::createFromPath($uploadedFile->file);
Fixed and 3.2.2 is now released.
I'm sorry for the inconvenience that this caused you.
Maybe it makes sense to create getter for this field, and make usage of public property deprecated?
Probably. We need to look at it, but I didn't want to slow down the release of 3.2.2.
It is possible to get the temp path with $uploadedFile->getStream()->getMetadata('uri'), but this is rather verbose. A simple getter would be nice.
Just for the record, in Slim v4 you can use $uploadedFile->getFilePath() to get the (temp) location of an uploaded file.
@zoolyka Slim 4 doesn't ship with a PSR-7 implementation so that wouldn't be a valid statement. Whichever PSR-7 implementation you have installed would provide that method.
@l0gicgate correct, thanks. I referred to the "default" slim/psr7 implementation.
Most helpful comment
It is possible to get the temp path with
$uploadedFile->getStream()->getMetadata('uri'), but this is rather verbose. A simple getter would be nice.