I am writing a desktop app in Java to upload a file to a folder on IIS server using HTTP PUT.
URLConnection urlconnection=null; try{ File file = new Fil
Possible bug: bis.read() can return a valid 0. You'll need to change the while condition to >= 0.
After you complete the loop where you are writing the BufferedOutputStream, call bos.close(). That flushes the buffered data before closing the stream.
BufferedOutputStream
bos.close()