The state file is updated after all request body writed into file. If file upload process is interupted by some errors, the content already uploaded and writen must be uploaded again.
Given a file size is 100MB, there are two upload strategy.
1. Upload less data(256KB...500kB) every time, clent need to issue 100MB/(segments size) times POST request.
2. Upload as many as possible data every time, it's the best to upload whole file by one POST request.
So, if server write data into temp file and record current range into state file at the same time, client could send the rest data at the next request.
How do you think about this?
If there is a chunk upload error (link break, server restart) client cannot get any feedback about what range actually got into. This is because range summary is send back only with success responses (200 or 201).
The hackish solution would be uploading empty (0 bytes) or small chunk of data just to get content of status file.