We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 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.