Hi Suneel,
I had already tried the above code, it is not working. I would save the file in application server; but when we check the same file after downloading it to local machine; it would give error message that "the file is damaged or could not be repaired".
Thanks,