点击确定的时候执行的修改操作,但是把file下以前存的都覆盖掉了,,怎么解决,求高手指点<%
    ProductSu ps = new ProductSu();
    IProductSuManager productSuMgr = ProductSuPeer.getInstance();
    boolean error = true;
    String filename = "";    boolean doCreate = ParamUtil.getBooleanParameter(request, "doCreate");
    if (doCreate) {
        com.bizwink.cms.kings.jspsmart.upload.File tmpFile = null;
        try {
            //实例化上载bean
            SmartUpload mySmartUpload = new SmartUpload();
            //初始化
            mySmartUpload.initialize(pageContext);
            //设置上载的最大值
            mySmartUpload.setMaxFileSize(50 * 1024 * 1024);
            try {
                //上载文件
                mySmartUpload.upload();
            } catch (Exception e) {
                response.sendRedirect("edit.jsp");
            }
            id = Integer.parseInt(mySmartUpload.getRequest().getParameter("id"));
            startflag = Integer.parseInt(mySmartUpload.getRequest().getParameter("startflag"));
            productname = mySmartUpload.getRequest().getParameter("productname");
            safestock = Integer.parseInt(mySmartUpload.getRequest().getParameter("safestock"));
            lastpurchasedate = mySmartUpload.getRequest().getParameter("lastpurchasedate");
            lastdeliverydate = mySmartUpload.getRequest().getParameter("lastdeliverydate");
            quantity = Integer.parseInt(mySmartUpload.getRequest().getParameter("quantity"));
            Files uploadFiles = mySmartUpload.getFiles();
            for (int i = 0; i < mySmartUpload.getFiles().getCount(); i++) {
                File tempFile = mySmartUpload.getFiles().getFile(i);
                if (!tempFile.isMissing()) {
                    filename = tempFile.getFileName();
                    System.out.println("tmf = " + tempFile.isMissing());
                    String ext = tempFile.getFileExt();                    String newfilename = String.valueOf(System.currentTimeMillis()) + "_" + i + "." + ext;
                    if (i == 0) {
                        maxpicture = newfilename;
                    }
                    if (i == 1) {
                        minpicture = newfilename;
                    }
                    if (i == 2) {
                        specificpicture = newfilename;
                    }
                    if (i == 3) {
                        picture = newfilename;
                    }
                    if (i == 4) {
                        titlepicture = newfilename;
                    }
                    if (i == 5) {
                        borntitlepicture = newfilename;
                    }
                    String uploadPath = application.getRealPath("/") + java.io.File.separator + "productpic" + java.io.File.separator;
                    java.io.File file = new java.io.File(uploadPath);
                    if (!file.exists()) {
                        file.mkdirs();
                    }                    boolean flag = tempFile.saveAs(uploadPath + newfilename);
                }            }
            mySmartUpload.stop();
        } catch (Exception
                e) {
            System.out.println(e.toString());            error = true;
        }        if (startflag == 1) {
            ps.setPicture(picture);
            ps.setTitlePicture(titlepicture);
            ps.setBornTitlePicture(borntitlepicture);
            ps.setSiteid(siteid);
            productSuMgr.updateProductSu(ps, id);
            response.sendRedirect("product.jsp");
        }
    }
    ps = productSuMgr.getByIdproduct(id);
%>
<HTML>
<HEAD><TITLE>修改商品信息</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <LINK href="../images/common.css" type=text/css rel=stylesheet>
    <LINK href="../images/forum.css" type=text/css rel=stylesheet>
    <SCRIPT language=javascript>
        function check()
        {
            if (form1.productname.value == "")
            {
                alert("请输入商品名称!");
                return false;
            }
            return true;
        }
                function goto()
        {
            form1.action = "product.jsp";
            form1.submit();
        }
    </SCRIPT>    <META content="MSHTML 6.00.2800.1479" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<FORM name=form1 action=edit.jsp?doCreate=true method=post enctype="multipart/form-data">
    <INPUT type=hidden value=1 name=startflag>
    <input type=hidden name="id" value="<%=id%>">    <CENTER>
        <TABLE cellSpacing=0 borderColorDark=#ffffff cellPadding=0 width=80%
               borderColorLight=#008000 border=1 enctype="multipart/form-data">
            <TBODY>
            <TR>
                <TD bgColor=#33ccff colSpan=2 height=32>
                    <P align=center>修改商品信息</P></TD>
            </TR>
                            <TD align=right>大图片:</TD>
                <TD align=left>&nbsp;<% if (ps.getMaxPicture() != null) { %>
                    <img src="<%="../../../"+"productpic" + "\\" +ps.getMaxPicture()%>" height="25"
                         width="50"><% } else { %>
                    --<% } %>&nbsp;<INPUT type="file" size=45 name=maxpicture value="" onpropertychange="f(this)">
                </TD>
            </TR>
            <TR height=32>
                <TD align=right>小图片:</TD>
                <TD align=left>&nbsp;<% if (ps.getMinPicture() != null) { %>
                    <img src="<%="../../../"+"productpic" + "\\" +ps.getMinPicture()%>" height="25"
                         width="50"><% } else { %>
                    --<% } %>&nbsp;<INPUT type="file" size=45 name=minpicture value="" onpropertychange="f(this)"></TD>
            </TR>
            <TR height=32>
                <TD align=right>特效图:</TD>
                <TD align=left>&nbsp;<% if (ps.getSpecificPicture() != null) { %>
                    <img src="<%="../../../"+"productpic" + "\\" +ps.getSpecificPicture()%>" height="25"
                         width="50"><% } else { %>
                    --<% } %>&nbsp;<INPUT type="file" size=45 name=specificpicture value="" onpropertychange="f(this)">
                </TD>
            </TR>
            <TR height=32>
                <TD align=right>原图:</TD>
                <TD align=left>&nbsp;<% if (ps.getPicture() != null) { %>
                    <img src="<%="../../../"+"productpic" + "\\" +ps.getPicture()%>" height="25"
                         width="50"><% } else { %>
                    --<% } %>&nbsp;<INPUT type="file" size=45 name=picture value="" onpropertychange="f(this)"></TD>
            </TR>
            <TR height=32>
                <TD align=right>标题图:</TD>
                <TD align=left>&nbsp;<% if (ps.getTitlePicture() != null) { %>
                    <img src="<%="../../../"+"productpic" + "\\" +ps.getTitlePicture()%>" height="25"
                         width="50"><% } else { %>
                    --<% } %>&nbsp;<INPUT type="file" size=45 name=titlepicture value="" onpropertychange="f(this)">
                </TD>
            </TR>
            <TR height=32>
                <TD align=right>原标题图:</TD>
                <TD align=left>&nbsp;<% if (ps.getBornTitlePicture() != null) { %>
                    <img src="<%="../../../"+"productpic" + "\\" +ps.getBornTitlePicture()%>" height="25"
                         width="50"><% } else { %>
                    --<% } %>&nbsp;<INPUT type="file" size=45 name=borntitelpicture value="" onpropertychange="f(this)">
                </TD>
            </TR>
            <TR height=32>
                <TD colSpan=2><FONT
                        color=red>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:带有*的项为必填项</FONT></TD>
            </TR>
            </TBODY>
        </TABLE>
        <P align=center><INPUT onclick="javascript:return check();" type=submit value=" 确 认 " name=Ok>&nbsp;&nbsp;
            <INPUT onclick=javascript:goto(); type=button value=返回列表 name=golist>
        </P>
    </CENTER>
</FORM>
</BODY>
</HTML>