Sample18: Implemented automatic file downloading from JS.