Fixed the download not working correctly

- the file wasn’t being written at the right place
- the download link was wrong