is it possible to write a script to download file from server to a specific folder in a client's computer
Only if the user gives you the file (i.e., with a <input type="file"> form field).