New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slim\Http\UploadedFile - no way to retrieve client-provided full path to the file #1798
Comments
If |
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 |
Just for the record, in Slim v4 you can use |
@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. |
Previously it was at least possible to use public variable $this->file.
Now there is not way to retrieve full path at all.
The text was updated successfully, but these errors were encountered: