利用SA FileUp组件进行多文件上传

2019-01-14 01:48:01刘景俊

                                          sql="update TBL_ALBUM set photoCount=photoCount+1 where albumID="&albumID
                                          conn.execute sql
                                          sql="update TBL_GROUP set photoCount=photoCount+1 where groupID="&groupID
                                          conn.execute sql              
                                          '===输出上传成功信息===
                                          iCount=iCount+1
                     End If

              Else
                     Response.Write strFormElement & "对象为空!"
              End If '--end if 对象为空
       End If '--end if 是否是文件
Next
Set oFileUp = Nothing  '删除此对象
end if '--end if 没有错误信息

response.write "<br>"&iCount&" 个文件上传结束!"
response.write "<br><a href='photo_listphoto.asp?albumID="&albumID&"'><B>返回相册</B></a>"
'=====如果有错,输出错误信息=====       
if errMsg<>"" then
       response.write "<br>"&errMsg
       response.write "<INPUT type='button' onClick='history.go(-1)' value='返回' class='myInput'>"
end if
conn.close
set conn=nothing
%>

===================================================
看完了实例,下面对SA FileUP的属性和方法进行简单的介绍,免得大家初次接触感到发晕。
这些是我觉得比较常用的,例句和注释都是按我的理解写的。
如果大家在应用中发现有什么问题,请指出。谢谢。

建立SA FileUp 对象的方法:
Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")

取出表单所有项的方法:
For Each strFormElement In oFileUp.Form
       用 oFileUp.Form(strFormElement)就可以引用每个对象,文件也是这样
       注意:如果是多选下拉框,则用oFileUp.FormEx(strFormElement)