3

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?

j0k
  • 22,600
  • 28
  • 79
  • 90
Bad Programmer
  • 3,642
  • 13
  • 46
  • 53

1 Answers1

11

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

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

Fenec
  • 1,224
  • 13
  • 21