⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image2.jsp

📁 A brew application taking backup of the device
💻 JSP
字号:
<%--    Document   : Image3    Created on : Feb 6, 2009, 3:56:53 PM    Author     : Work IS Passion--%><%@ page import="java.io.*" %><%@page import="IPhone.*" %><? xml version="1.0" encoding="ISO-8859-1" ?><%  String savePath = "F:\\MyFolder\\";  String filename = "";  ServletInputStream in = request.getInputStream();    byte[] line = new byte[128];  int i = in.readLine(line, 0, 128);    int boundaryLength = i - 2;  String boundary = new String(line, 0, boundaryLength);      while (i != -1) {    String newLine = new String(line, 0, i);    if (newLine.startsWith("Content-Disposition: form-data; name=\"")) {      String s = new String(line, 0, i-2);      int pos = s.indexOf("filename=\"");      if (pos != -1) {        String filepath = s.substring(pos+10, s.length()-1);                pos = filepath.lastIndexOf("\\");        if (pos != -1)          filename = filepath.substring(pos + 1);        else          filename = filepath;      }          i = in.readLine(line, 0, 128);     i = in.readLine(line, 0, 128);           i = in.readLine(line, 0, 128);      ByteArrayOutputStream buffer = new ByteArrayOutputStream();      newLine = new String(line, 0, i);      while (i != -1 && !newLine.startsWith(boundary)) {                buffer.write(line, 0, i);        i = in.readLine(line, 0, 128);        newLine = new String(line, 0, i);      }      try {                RandomAccessFile f = new RandomAccessFile(          savePath + filename, "rw");        byte[] bytes = buffer.toByteArray();        f.write(bytes, 0, bytes.length - 2);        f.close();      }      catch (Exception e) {}    }    i = in.readLine(line, 0, 128);  } %>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -