create download file interface

1. Add download file function
2. Fix bugs of dfs