public class PicCreateCtrl extends HttpServlet{
public PicCreateCtrl(){
super();
}
public void destroy(){
super.destroy();//Just puts"destroy"string in log
//Put your code here
}
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
doPost(request,response);
}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
response.setContentType("text/html;charset=gb2312");
PrintWriter out=response.getWriter();
SmartUpload mySmartUpload=new SmartUpload();//creat new SmartUpload object long file_size_max=10000000;//the bigest size of file
String fileExt="";
String url="temp/";//the path of save upload file
mySmartUpload.initialize(this.getServletConfig(),request,response);
try{
mySmartUpload.setAllowedFilesList("png,emf,bmp,jpg,gif,BMP,JPG,GIF,PN G,EMF");
//上载文件
mySmartUpload.upload();
}catch(Exception e){
e.printStackTrace();
out.print("");
}
try{
BaseduManager manager=new BaseduManager();
File myFile=mySmartUpload.getFiles().getFile(0);
String xh=mySmartUpload.getRequest().getParameter("xcxh");
if(myFile.isMissing()){
out.print("