Upload a file using HTTP put in Java

后端 未结 2 557
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-14 10:45

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         


        
2条回答
  •  情深已故
    2021-01-14 11:39

    After you complete the loop where you are writing the BufferedOutputStream, call bos.close(). That flushes the buffered data before closing the stream.

提交回复
热议问题