In case of uploading breakdown, we won't to calculate md5 from begining.
So add the functions to continue md5_update().
add save/load context for md5
Using files to store the context seems to be too specific. Maybe it's sufficient to expose APIs to fetch and restore (opaque) ctx data? Like adding the get_context and set_context methods?
Break uploading maybe during many days, or user may upload part of a file and abandon it. These behaviors would produce some garbage data in context.
And the context data must be related with the parted files, the relationship should be maintained in application.
So it's more reasonable to give application control to decide how to store the context data.