在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java/ 請問怎么建一個html頁面用來傳輸圖片

請問怎么建一個html頁面用來傳輸圖片

本來我是做.net 但是需要對接別人java的回調(diào)的接口 他那邊是get方式請求一個地址

這個地址是我給他的
他的代碼是這個樣的

 boolean bool = true;
  HttpClient client = new DefaultHttpClient();
  HttpResponse httpResponse = null;
  HttpGet get = null;
  try {
     get = new HttpGet(url);
     httpResponse = client.execute(get);            
     if(httpResponse.getStatusLine().getStatusCode() == 200){
      HttpEntity httpEntity = httpResponse.getEntity();
        InputStream inputStream = httpEntity.getContent();
        File file = new File(path);
        if(!file.exists()){
            file.mkdirs();
        }
        String fileName=  url.substring(url.indexOf("imageName")+10,url.length());
        String imgPath = path + File.separator + fileName;
              
        OutputStream outStream = new FileOutputStream(imgPath);
        IOUtils.copy(inputStream, outStream);
        inputStream.close();
        outStream.close();
        bool = true;

http://100.96.36.36:9258/image/showImage.html?imageName=1712.JPG

我傳給他一個這樣的地址 他就用上面的代碼請求 請問 我這個showImage頁面應(yīng)該怎么寫?

回答
編輯回答
薔薇花

代碼我就不看了,給你個思路,上傳圖片你說到是用HTML作為上傳界面,那就和你.net沒啥關(guān)系了,直接通過from表單上傳圖片給他的接口,拿到文件后,你們再交互就ok了

2018年5月30日 07:35