In localhost I can delete, copy my folder and files just fine. However, after I host my web app, those functions don't work on the server.
Here is the error that I got:
Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator ::__construct(/home/solution/public_html/portalprojectcdr/backend/web/The Library/ISU/New directory) : failed to open dir: No such file or directory' in /home/solution/public_html/portal/backend/views/site /submit_upload_to_server.php:73
As there seems to be a new directory involved in your error, i suppose you should check permission and owners for your files.
Please mass downvote if this advice in unsecure, but i use it on production : Define the user www-data as owner of the file and folder that must be writable. If you are not on production, you can try a naughty chmod 777 where needed, to see if your problem is really permission related.
Don't forget to put permission back to normal after your test.