Asp classic 如何在服务器目录上上载映像

Asp classic 如何在服务器目录上上载映像,asp-classic,upload,Asp Classic,Upload,您好,关于java小程序部分,我正在使用以下代码发送上载请求。asp页面上载服务器目录中的图像。请在asp classic中告诉我如何在不使用第三方dll的情况下上载服务器目录中的图像 Dimension size = perfchart.getSize(); BufferedImage myImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB); Graph

您好,关于java小程序部分,我正在使用以下代码发送上载请求。asp页面上载服务器目录中的图像。请在asp classic中告诉我如何在不使用第三方dll的情况下上载服务器目录中的图像

  Dimension size = perfchart.getSize();
  BufferedImage myImage = new BufferedImage(size.width,
            size.height, BufferedImage.TYPE_INT_RGB);
  Graphics2D g2 = myImage.createGraphics();
  perfchart.paint(g2);

  URL url = new URL(uploadURL);

  connection = (HttpURLConnection) url.openConnection();

  connection.setDoOutput(true);

  connection.setRequestMethod("POST");

  connection.setDoInput(true);  

  connection.setUseCaches(false);
  connection.setRequestProperty("Content-Type", "image/png");
  connection.setRequestProperty("Content-Transfer-Encoding", "binary");
  connection.setRequestProperty("Content-Disposition", "form-data; name=\"" + FIELD_NAME +"\"; filename=\"" + fileName + "\"");
  output = new DataOutputStream(connection.getOutputStream());

  output.writeBytes("--" + boundary + "\r\n"); // throws IOException
  ImageIO.write(image, imageType, output);

所以请告诉我如何通过asp经典上传图片。这段java代码是否需要更改请告诉我这也是经典asp的解决方案:

纯asp上传:服务器现在没有响应

但是,如果您的服务器启用了.net,我建议您使用.net解决方案:


不确定这和wordpress有什么关系?因为这是关于一个java小程序和一个上传ASP页面,我想这与wordpress无关,至少不是第一手的。投票结束。他可能把这和StackOverflow混淆了。应该迁移到SO。