/* Cleans up open file handle and state when upload is finished.  */
static void fs_mgmt_upload_download_finish_check(void)
/* Cleans up open file handle and state when upload is finished.  */
static void fs_mgmt_upload_download_finish_check(void)
{
	if (fs_mgmt_ctxt.len > 0 && fs_mgmt_ctxt.off >= fs_mgmt_ctxt.len) {
		k_work_cancel_delayable(&fs_mgmt_ctxt.file_close_work);
		fs_mgmt_cleanup();
	} else {
		k_work_reschedule(&fs_mgmt_ctxt.file_close_work, FILE_CLOSE_IDLE_TIME);
	}
}