R
R
RZ2017-08-29 13:44:57
Yii
RZ, 2017-08-29 13:44:57

Why does Yii2 extension check not work correctly?

In general, I implemented the check of uploaded files (mp3) in the rules and everything worked as expected until one interesting moment... If there is more than one dot in the file name, then yii does not skip this file, giving an error that the file format is incorrect, and it's correct, at the end of the .mp3 extension is indicated. It's strange, of course, that yii checks the file extension for the first point that comes across ....
Maybe there is some kind of non-crutch way to change the behavior? Or maybe some parameter needs to be added before validation? Frankly speaking, I picked off the site, but did not find anything suitable.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mitaichik, 2017-08-29
@mitaichik

Hardly a problem with that. Yii does not add any logic, but uses the standard PHP pathinfo($this->name, PATHINFO_EXTENSION).
He correctly fulfills your situation php.net/manual/ru/function.pathinfo.php
Most likely, a problem in another. I advise you to debug it all and see what's really going on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question