Getting Content of PHP file upload error

15,399

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

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

Share:
15,399
Bad Programmer
Author by

Bad Programmer

A self-taught PHP programmer.

Updated on June 23, 2022

Comments

  • Bad Programmer
    Bad Programmer almost 2 years

    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?