国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

圖片數據的存和取示例

2019-11-18 21:32:36
字體:
來源:轉載
供稿:網友
圖片數據存入數據庫
        sqlstr="select * from "&tbname&" where id is null"
        set rs=server.createobject("adodb.recordset")
        rs.Open sqlstr,conn,1,3
        rs.AddNew ()
        rs("title")=title
        rs("filename")=filename
        rs("filetype")=filetype
        rs("thelevel")=thelevel
        rs("uploaddate")=date()
        rs("uploadip")=request.ServerVariables("REMOTE_ADDR")
        rs("contenttype")=contenttype
        rs("data").AppendChunk (binstr)
        rs("size")=size
        rs("offset")=offset
        rs.Update
        rs.Close()

讀取顯示:
    rs.Open sqlstr,conn,3
    if not rs.EOF then
            contenttype=rs("contenttype")
            binstr=rs("data").GetChunk(rs("size")+rs("offset"))
            if rs("offset")=1 then
                binstr=midb(binstr,2)
            end if
            if instr(contenttype,"text/")=1 or _
               instr(contenttype,"image/")=1 or _
               instr(contenttype,"application/msWord")=1 then
                response.contenttype=trim(contenttype)
                response.binarywrite binstr
            else
                response.addheader "Content-Disposition","attachment;filename="""&rs("filename")&""""
                response.contenttype=trim(contenttype)
                response.binarywrite binstr
            end if
            if request("PReview")<>"yes" then
                sqlstr="update "&tbname&" set downtimes=downtimes+1 where id="&fileid
                conn.Execute sqlstr
            end if
    end if
說明:
對于超長的二進制數據(如圖像數據)要使用fieldname.AppendChunk() 和fieldname.GetChunk()來讀寫。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黎川县| 西和县| 镇康县| 高淳县| 临桂县| 板桥市| 武山县| 鄂托克前旗| 龙岩市| 察隅县| 五峰| 项城市| 望奎县| 革吉县| 五家渠市| 涿鹿县| 承德县| 来凤县| 资溪县| 兴海县| 宁国市| 克山县| 柞水县| 洪泽县| 沂南县| 夏河县| 乌拉特后旗| 清原| 博兴县| 永福县| 横峰县| 景洪市| 汉阴县| 黄浦区| 德安县| 谷城县| 莆田市| 潮安县| 巴青县| 砀山县| 佛山市|