-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add method returning client provided file path #166
Add method returning client provided file path #166
Conversation
UploadedFile class has a property containing temporary path of the uploaded file, which is inaccessible outside of the class. But there is a need of accessing this property outside of the class, when for example you must upload the uploaded file directly to the cloud(e.g. Amazon S3 bucket) without saving it to your local file system. So a getter method is created returning the value of this property.
@l0gicgate @akrabat can you please merge this PR as soon as possible? |
@hhovakimyan this is not part of the PSR-7 spec, that's why it has not been implemented. Unfortunately I don't think this is necessary, it seems like this is only for the edge case in your application. @akrabat what are your thoughts on this? |
@l0gicgate first I don't think the case in my application is an edge case. I think many people would like to send the uploaded file directly to cloud(AWS S3 bucket, Google Drive, Dropbox, etc) without copying it to local file system and then deleting the local copy after upload succeeds. Second, if yo want to strictly follow the PSR-7 spec, there is also the option of changing the access modifier of $file property from protected to public. In Slim 3 the $file property of UploadedFile class was a public property and I used it for getting the value of uploaded file's tmp path. That's why I have a backward compatibility issue after migrating from Slim 3 to Slim 4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn’t aware this was a regression from Slim 3.
Just for the record saying things like “Can we get this merged as fast as possible” makes me not want to merge PRs.
Instead I would advocate using suggestive language like “Would it be possible to get this merged in a timely manner?”
Thank you for your contribution
@l0gicgate thanks a lot for merging this pull request. Sorry for the way I have asked about merging this PR. Next time I will use suggestive language in such cases. Also can you tell me please when the 1.2 milestone is planned to be released? |
@hhovakimyan just released for you: |
Thanks @hhovakimyan. |
UploadedFile class has a property containing temporary path of the
uploaded file, which is inaccessible outside of the class. But there is
a need of accessing this property outside of the class, when for
example you must upload the uploaded file directly to the cloud(e.g.
Amazon S3 bucket) without saving it to your local file system. So a
getter method is created returning the value of this property.