server: refine code logic in handleDownloadFile (#30422)
server: refine code logic in handleDownloadFile (#30422)

* refine logic

Signed-off-by: yisaer <f222f204032533a6fcbe6e5ff6aed541ec6b4541@163.com>

* fix

Signed-off-by: yisaer <f222f204032533a6fcbe6e5ff6aed541ec6b4541@163.com>
pingcap/tidb,ngaut/tidb,pingcap/tidb,pingcap/tidb,kyle-wang/tidb,c4pt0r/tidb,kyle-wang/tidb,ngaut/tidb,c4pt0r/tidb,kyle-wang/tidb,ngaut/tidb,ngaut/tidb,c4pt0r/tidb,pingcap/tidb,pingcap/tidb,kyle-wang/tidb,kyle-wang/tidb,ngaut/tidb,c4pt0r/tidb,ngaut/tidb,kyle-wang/tidb,pingcap/tidb,c4pt0r/tidb,c4pt0r/tidb