You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use yii\web\MultipartFormDataParser as a request parser
upload file using PATCH method
use UploadedFile to instanciate the file
What is the expected result?
When using UploadedFile::saveAs() file is saved into specified directory.
What do you get instead?
Since it uses php-s move_uploaded_file() or is_uploaded_file() which check if php itself dealt with uploaded file (which it didn't), file is not saved.
Additional info
yii\web\MultipartFormDataParser deals with $_FILES itself not php.
We attempted an upgrade from 2.0.14. For us this seems to be happening with latest #2.0.18 version using POST also. Any advice? File do not get saved, type not identified and files shows error 3 and validation trigger the file type missing. All works fine when we downgrade to 2.0.14.1.
Note: although this parser fully emulates regular structure of the $_FILES, related temporary files, which are available via tmp_name key, will not be recognized by PHP as uploaded ones. Thus functions like is_uploaded_file() and move_uploaded_file() will fail on them. This also means yii\web\UploadedFile::saveAs() will fail as well.
What steps will reproduce the problem?
yii\web\MultipartFormDataParser
as a request parserWhat is the expected result?
When using UploadedFile::saveAs() file is saved into specified directory.
What do you get instead?
Since it uses php-s
move_uploaded_file()
oris_uploaded_file()
which check if php itself dealt with uploaded file (which it didn't), file is not saved.Additional info
yii\web\MultipartFormDataParser
deals with $_FILES itself not php.Relates to #6996 but is not the same.
The text was updated successfully, but these errors were encountered: