无组件上传样本SQLServer数据库的例子

无组件上传样本SQLServer数据库的例子
我只是尝试上传没有组件,所以提供代码共享。

addemployee.asp / * * /

标题:uff1a

分类:
文本:

图片:
1、你上传图片的大小请控制在500K,否则不允许上传

2。你上传的图片必须是150×130像素。

三.上传和上传的图片格式是JPG或GIF。
U3000 U3000

*************************************************************************

/ * * / ASP transact1。
如果Request.ServerVariables(request_method )=后然后
昏暗的领域
昏暗的strtitle,strsort,strcontent
昏暗的RS,ssql
昏暗的imaxid
昏暗的strmaxid
昏暗的strlen

设置字段= getupload()
strtitle = binarytostring(字段(txttitle)。值)
strsort = binarytostring(字段(txtsort)。值)
strcontent = binarytostring(字段(txtcontent)。值)
strsort =分裂(TRIM(strsort),)

如果仪器(1,1例(字段(文件)。文件名),jpg)= 0和仪器(1,1例(领域))
response.write
response.write
response.end
最后如果

如果字段(),那么长度> 500000
response.write
response.write
response.end
最后如果

保存到数据库。
如果字段(文件)。
集= server.createobject(ADODB。记录集)
ssql =SELECT * FROM员工订单ID号
Rs.open sSql,Conn,2
if not rs.eof then
imaxid = Clng(RS(ID))+ 1
= 4-len strlen(CSTR(imaxid))
strmaxid =字符串(字符串,0 )CSTR(imaxid)
其他的
strmaxid =0001
最后如果
rs.addnew
RS(ID)= strmaxid
RS(标题)= strtitle
RS(类)= strsort(0)
RS(IMG)。AppendChunk Fields(文件)的价值。
RS(内容)= quotechg(strcontent)
RS(*)=日期()
rs.update
关闭
response.write
最后如果
最后如果
%>

**********************************************************************
/ * * /公司fupload。

tag:数据库上传样本例子无组件

相关内容