It's really up to you to decide. Everything that the server receives is just going to be bytes so it is up to you to determine an appropriate protocol so that the server knows how to interpret that data. For instance, you might start every communication with a number that represents the type of the communication. The number 1 might represent a file upload, so when the server reads the number 1, it knows that it needs to interpret the subsequent data in an appropriate manner for an uploaded file. You might want to follow that with a number representing the size of the file. You will presumably need to communicate the file type somehow as well. You can then send the file contents and the server will know exactly how many bytes to read, so it will be able to calculate the progress as it goes.
Hopefully you're getting a feel for the fact that software development is more than just writing code. You need to spend some time designing the software before you implement it, working out the logic before you write the code to perform it. Think about the sorts of steps you would need to perform in a manual process, because the application will have to perform mostly the same steps.