Foxtable(狐表)用户栏目专家坐堂 → ftp动态设置文件存储位置,帮助例子实现不了


  共有2548人关注过本帖树形打印复制链接

主题:ftp动态设置文件存储位置,帮助例子实现不了

帅哥哟,离线,有人找我吗?
pzhwjx
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:132 积分:1833 威望:0 精华:0 注册:2016/4/22 22:41:00
ftp动态设置文件存储位置,帮助例子实现不了  发帖心情 Post By:2019/10/12 0:44:00 [只看该作者]

如题,测试帮助文档里的例子只能实现本地电脑,远程没法实现。

Select Case e.DataCol.Name
    Case "图片" '如果在图片列插入文件
        e.Subfolder = e.DataRow("部门"'将此文件存放在目录名为部门名称的子目录中.

End
Select


局域网络版Serv-U架构滴ftp服务器如何实现动态设置文件存储位置。请教如何代码实现。


 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107864 积分:548683 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/10/12 8:47:00 [只看该作者]

这种要自己写代码上传文件:http://www.foxtable.com/webhelp/topics/1410.htm

 回到顶部
帅哥哟,离线,有人找我吗?
shenyl0211
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:977 积分:6835 威望:0 精华:0 注册:2012/4/2 21:49:00
  发帖心情 Post By:2019/10/13 13:41:00 [只看该作者]

BeforeAddFile:

例子:

If e.DataCol.name = "附件" Then

    Select Case e.DataTable.Name

        Case "审查管理"

            If _username = e.DataRow("项目经理") OrElse _username = e.DataRow("编写设计") Then

                e.Cancel = False

                Dim filepath As String = "/审查管理/" & e.DataRow("编写设计")

                If ftp1.DirExists(filepath) = False Then

                    ftp1.MakeDir(filepath)

                End If

                e.path = filepath

                ftp1.RootDir = filepath

            Else

                e.cancel = True

            End If

        Case "文件管理"

            If _username = e.DataRow("发布人") OrElse (_usergroup.Contains(e.DataRow("发布部门")) AndAlso (_userroles = "部门领导" OrElse _userroles = "财务领导" OrElse _userroles = "生产领导")) Then

                e.Cancel = False

                If e.DataRow.IsNull("文号年份") Then

                    MessageBox.Show("《文号年份》不能空")

                    e.Cancel=True

                    Return

                End If

                Dim filepath As String = "/文件管理/" & e.DataRow("文号年份")  & "/" & e.DataRow("发布人")

                If ftp1.DirExists("/文件管理/" & e.DataRow("文号年份")) = False Then

                    ftp1.MakeDir("/文件管理/" & e.DataRow("文号年份"))

                End If

                If ftp1.DirExists(filepath) = False Then

                    ftp1.MakeDir(filepath)

                End If

                e.path = filepath

                ftp1.RootDir = filepath

            Else

                e.cancel = True

            End If

        Case "固资申请","合同评审"

            If (_username = e.DataRow("申请人") AndAlso e.DataRow.IsNull("审批日期")) OrElse _userroles = "开发者" Then

                e.Cancel = False

                Dim ab1 As Date = e.DataRow("申请日期") ’含时间

                Dim ab2 As String = CStr(ab1)

                ab2=ab2.SubString(0,4) & ab2.SubString(5,2) & ab2.SubString(8,2) & ab2.SubString(11,2) & ab2.SubString(14,2)

                Dim str As String = e.DataTable.Name

                Dim filepath As String = "/" & str & "/" & e.DataRow("申请人") & "/" & ab2

                If ftp1.DirExists("/" & str & "/" & e.DataRow("申请人")) = False Then

                    ftp1.MakeDir("/" & str & "/" & e.DataRow("申请人"))

                End If

                If ftp1.DirExists(filepath) = False Then

                    ftp1.MakeDir(filepath)

                End If

                e.path = filepath

                ftp1.RootDir = filepath

            Else

                e.cancel = True

            End If

    End Select

End If


 回到顶部