java 高手进,解释此段代码

来源:百度知道 编辑:UC知道 时间:2024/06/14 06:38:00
boolean isSuccess = false;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(get, "jpg", baos);
byte by[] = baos.toByteArray();
Socket socket = new Socket(InetAddress.getByName(Snapshot.access$4(Snapshot.this)), Snapshot.access$5(Snapshot.this));
socket.setSoTimeout(Snapshot.access$6(Snapshot.this));
BufferedOutputStream wr = new BufferedOutputStream(socket.getOutputStream());
BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String body = (new StringBuilder("--aadfsfssfsdfs\r\ncontent-Disposition: form-data; name=\"pic_path\"\r\nContent-Type: text/plain\r\n\r\n")).append(picPath).append("\r\n").append("--aadfsfssfsdfs\r\n").append("content-Disposition: form-data; name=\"pic_file\"; filename=\"").append(picMame).append(&quo

其实图片的信息已经post过去了,你用 $[files][name]可以获得的。你试试。。。其他信息也应该有了的。

在你post的文件的时候,文件名同时会post,不用你再传。我不懂asp,估计在request这个东西里头是不是有个方法getFilename

你是按HTTP协议的方式发送的数据,接受的页面是什么的无所谓
picMame是第三个要传的,你只要写法和第一个传的pic_path写法一样就行了,并向前两个一样加上"--aadfsfssfsdfs\r\n"

帮助他