Download function is now working
There was a problem of input/outputStream...