To save file on client side:
for non-IE browser, you can use document.location='data:application/octet-stream;base64,SGVsbG8=
for IE, you can use document.execCommand('save', null, 'name')