//代码块
package servlet;
import java.awt.Desktop;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PushbackInputStream;
import java.net.URL;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadBase;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import wordConvertHtml.Word2007ToHtml;
import wordConvertHtml.wordConvert03;
/**
* Servlet implementation class upload2
*/
public class upload2 extends HttpServlet {
private static final long serialVersionUID = 1L;
public upload2() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
// TODO Auto-generated method stub
boolean is2003=true;
String suffix="";
String filename2="";
String realPath2="";
String savePath = this.getServletContext().getRealPath("/upload");
String tempPath = this.getServletContext().getRealPath("/WEB-INF/temp");
File tmpFile = new File(tempPath);
if (!tmpFile.exists()) {
//
用原生的Servlet来上传文件
最新推荐文章于 2023-07-30 22:30:35 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)