l9110驱动电路:asp上传图片。
来源:百度文库 编辑:高校问答 时间:2024/08/28 06:03:42
上传页代码
<INPUT name="saveto" type=radio value="db" checked>
目录
<INPUT type=radio name="saveto" value="fd">
验证页代码
If Not Request.TotalBytes < 1 then
Set objLoad = New DevyUpLoad
objLoad.UpLoad()
objRs.AddNew()
objRs("productname") = objLoad.Form("productname").value
objRs("content") = objLoad.Form("content").value
If objLoad.Form("saveto").value = "db" then
'objRs("SFlag") = 0
objRs("fType") = objLoad.fileType
objLoad.SaveToDB(objRs("fData"))
Else
'objRs("SFlag") = 1
fName = MakeFileName(objLoad.fileName)
objRs("pic") = fName
objRs("fType") = objLoad.fileType
objLoad.SaveAs(Server.MapPath("file\" & fName))
End If
objRs.Update()
Set objLoad = Nothing
End If
Function MakeFileName(fName)
Dim nmStr,eName
nmStr = Replace(Replace(Replace(Now()," ",""),"-",""),":","") & Session.SessionID
eName = Trim(Right(fName,InStr(StrReverse(fName),".")))
MakeFileName = nmStr & eName
End Function
其中有一句objRs("pic") = fName
这个句不知道是怎么获值的。pic为数据库字段。
<INPUT name="saveto" type=radio value="db" checked>
目录
<INPUT type=radio name="saveto" value="fd">
验证页代码
If Not Request.TotalBytes < 1 then
Set objLoad = New DevyUpLoad
objLoad.UpLoad()
objRs.AddNew()
objRs("productname") = objLoad.Form("productname").value
objRs("content") = objLoad.Form("content").value
If objLoad.Form("saveto").value = "db" then
'objRs("SFlag") = 0
objRs("fType") = objLoad.fileType
objLoad.SaveToDB(objRs("fData"))
Else
'objRs("SFlag") = 1
fName = MakeFileName(objLoad.fileName)
objRs("pic") = fName
objRs("fType") = objLoad.fileType
objLoad.SaveAs(Server.MapPath("file\" & fName))
End If
objRs.Update()
Set objLoad = Nothing
End If
Function MakeFileName(fName)
Dim nmStr,eName
nmStr = Replace(Replace(Replace(Now()," ",""),"-",""),":","") & Session.SessionID
eName = Trim(Right(fName,InStr(StrReverse(fName),".")))
MakeFileName = nmStr & eName
End Function
其中有一句objRs("pic") = fName
这个句不知道是怎么获值的。pic为数据库字段。
fName = MakeFileName(objLoad.fileName)
没有看到吗?