PS File upload is extremely tricky, it can cause a lot of problems.
Instead of opening the door to your server/webspace to unauthorized users, you might want to use imgur.com service to enable image upload in your application. By the way, it is free https://apidocs.imgur.com
Instead of opening the door to your server/webspace to unauthorized users, you might want to use imgur.com service to enable image upload in your application. By the way, it is free https://apidocs.imgur.com