I want to download a file from server without forcefully open by browser and i want to download it in particular directory.

I have one .js which prevent browser from opening the file and display a 'Save As' dialogue box. When i save the file, the content of file is blank.

following is the code

<script language='javascript'>
function downloadme(x)
myTempWindow = window.open(x,'','left=10000,screenX=10000');
myTempWindow.document.execCommand('SaveAs','null',x); myTempWindow.close();

<a href=javascript:downloadme('\kk.doc');>Download this Doc</a>

Plz help me out from this problem