This is a project for a test to get a job. Use compressor.js for compress the image and send through http and the server side is with php language. Also, use AJAX with fetch to send the image with POST Method and only accept .jpg and .jpeg extensions.
To run this project remember apply sudo chmod -R 777 to the repo folder, to write and move the images.
Note: remember don't print or echo a string before the json, it cause error.