Show.jsp
<%@ page contentType="text/html; charset=gb2312"%>
<%@ include file="/DataIni/DataOpen.jsp"%>
<%@ include file="/ScriptLib/Init.jsp"%>
<%
String Id;
Id=request.getParameter("Id");
oracle.sql.BLOB m_Blob;
odbcQuery="select Body from Project_Design where ID="+Id;
odbcRs=odbcStmt.executeQuery(odbcQuery);
if(odbcRs.next())
{
System.out.println(odbcQuery);
OutputStream pOut=response.getOutputStream();
response.setContentType("application/msword"); m_Blob=(oracle.sql.BLOB)odbcRs.getBlob("Body");
byte[] Buffer=m_Blob.getBytes(1,(int)m_Blob.length());

pOut.write(Buffer);
pOut.close();
pOut.flush();
response.flushBuffer();
}
else
{
System.out.println(odbcQuery);
}
odbcRs.close();
%>
<%@ include file="/DataIni/DataClose.jsp"%>

解决方案 »

  1.   

    显示:
    <script>
    function ShowReadOnly(Id)
    {
    var hwnd=window.open('','','');
    hwnd.document.write("<table border='0' width='100%'>");
    hwnd.document.write("  <tr>");
    hwnd.document.write("    <td width='100%' align='center' style='font-size:9pt'>缩略</td>");
    hwnd.document.write("  </tr>");
    hwnd.document.write("  <tr>");
    hwnd.document.write("    <td width='100%'><iframe src='Show.jsp?Id="+Id+"' style='width:100%;height:400px;'></iframe></td>");
    hwnd.document.write("  </tr>");
    hwnd.document.write("</table>");
    }
    </script>
    <a href="#" onclick="ShowReadOnly('<%=Id%>')">缩略<%=Id%></a>
      

  2.   

    我怎么用 javascript 读取一个文件的内容,再把它传到服务器上.
      

  3.   

    <INPUT TYPE="File" NAME="uploadFileName">把复杂的事做简单了----->贡献
    把简单的事做复杂了=====>犯罪
      

  4.   

    to  gjd111686(数字金刚) 
    能不能把你 include 的几个文件也贴上来呀.