Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Content of PHP file upload error

I am working with the move_uploaded_file() function in PHP. I've managed to successfully troubleshoot a problem I was encountering, but I would like to be able to get the actual content of the warnning or error message. According to php.net (http://php.net/manual/en/function.move-uploaded-file.php) the move_uploaded_file() function returns FALSE and a warning on failure. I want the actual content of the warning, such as "failed to open stream: Permission denied..." so that I can record which errors are occurring. Is there a way to do this?

like image 447
Bad Programmer Avatar asked Oct 15 '25 00:10

Bad Programmer


1 Answers

You can do using this: $_FILES['userfile']['error']

More info: http://php.net/manual/en/features.file-upload.errors.php

like image 93
Fenec Avatar answered Oct 17 '25 17:10

Fenec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!