file downloading using client-side javascript