We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

how to get the field name of an uploaded file in Controller::request?

Controller::request->getUloadedFiles() does not contain the name of the input field.



17.8k
Accepted
answer

Yes, it contains it:

$file->getName();

https://docs.phalcon.io/en/latest/api/Phalcon_Http_Request_File.html

I find the getKey method to get the name value of the input.