我需要把当前上传的文件插到数据库的某个字段里
下载的时候也是从数据库里下载数据库是oracle10g,请问大家有什么办法
该如何实现?

解决方案 »

  1.   

    如果需要存到数据库里
    参考
    http://blog.163.com/8405888/blog/static/12799222009874283047/
      

  2.   


    读出数据,输出相关类型如
    Response.AppendHeader("Content-Disposition","attachment;filename="+File+"");
    Response.ContentType ="application/octet-stream""; 
    Response.WriteFile("");
    Response.End();
      

  3.   

    我用Sqlservr做过此类东东,放到数据库里,一般存放形式的都是二进制,那你就用从流内读成byte[]再放数据库吧,读也用byte[]从数据库中读出再写入流中最后发给客户端
      

  4.   

    存的时候把文件名如 text.Doc 保存(列:filename)起来,再把文件转成二进制存在 Blob字段(列:fj)中下载的时候 string filename=myset.Tables[0].Rows[0]["fjmc"].ToString().Trim();
    byte[] myfile=new byte[j];
    myfile=(byte[])myset.Tables[0].Rows[0]["fj"]; this.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(""+filename+""));
    Response.BinaryWrite(myfile);
    Response.End();