Language Used: PHP
Version: 5.6
I am trying to upload a file to the server with the following function:
move_uploaded_file($source,$destination);
Whenever file fails to upload due to any reason such as
It simply raises a warning and continues with other parts of the code. But I want to catch that warning and change the flow of the program if any of the warnings are raised with their name so that I can throw appropriate Exception.
I am currently using try{}catch(){}
block to upload a file but an exception is not raised for the warning.
Edited Found this...
move_uploaded_file($source,$destination);
returns true or false based on status of file upload. But it does not specify reason. How to know that?