同问,顺道问一下楼主是准备写到什么数据库
我是写到mysql的

解决方案 »

  1.   

    我准备把图片,用数据库存储,没办法.老板要求
    问题是怎样才可以把"流"写进数据库???????????
    asp可以用recordset.add  
    recordset("img").appendchunk input
    recordset.update
    那jsp怎样实现呢??????????????????????????????????????
      

  2.   

    请问有朋友可以版我解答嘛
    有个index.htm
    <form action="process.jsp" method="post" enctype="multipart/form-data" name="form1">
      <input type="file" name="file">
      <input type="submit" name="Submit" value="提交">
    </form>
    process.jsp应该怎样写~来储存入数据库.
    process.jsp
    <%
    ServletInputStream is=request.getInputStream();
    int size = request.getContentLength();
    byte[] isb = new byte[size];
    byte[] buff =  new byte[size];
    int count = 0;
    int rbyte = 0;
    while (count < size) {rbyte = is.read(buff); 
    for(int i=0;i<rbyte;i++) {
    isb[count + i] = buff[i];
    }
    count += rbyte;
    }
    %>
    这样写对嘛,后面应该怎样写主要是怎把流储存入数据库
      

  3.   

    ServletInputStream is=request.getInputStream()可以这样用吗?不懂 学习 up