以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]独立制作cell,如何上传文件夹  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=56405)

--  作者:liujywwy
--  发布时间:2014/9/4 15:25:00
--  [求助]独立制作cell,如何上传文件夹

点击目录右边的cell按钮没反应,请帮忙看看哪里有问题。

上传目录click代码如下:

Dim dlg As New FolderBrowserDialog
If dlg.ShowDialog = DialogResult.OK Then
    Dim c As Col = CurrentTable.Cols(CurrentTable.ColSel)
    Dim ftp As FTPClient = c.DataCol.FTPClient
    If ftp.Upload(dlg.SelectedPath, "/ " & FileSys.GetName(dlg.SelectedPath)) Then
        CurrentTable.Current(c.Name) = "/ " & FileSys.GetName(dlg.SelectedPath)
    End If
End If

e.Form.Close

 

cellbuttonclick代码如下:

If e.Col.Name = "目录" Then
        e.Cancel = True
    If e.Row.IsNull(e.Col.Name) = False Then
        Forms("上传目录").Open(windows.Forms.Cursor.position.x, windows.Forms.Cursor.position.y)
    End If
End If

目录列的扩展如附件

 


图片点击可在新窗口打开查看此主题相关图片如下:扩展.png
图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2014/9/4 15:30:00
--  
自行编码来,不要取列的FTPCLIENT 看看
--  作者:有点甜
--  发布时间:2014/9/4 15:31:00
--  

If e.Col.Name = "目录" Then
    If e.Row.IsNull(e.Col.Name) = False Then

        e.Cancel = True
        Forms("上传目录").Open(windows.Forms.Cursor.position.x, windows.Forms.Cursor.position.y)
     
    End If
End If


--  作者:liujywwy
--  发布时间:2014/9/4 15:49:00
--  

上传目录click代码如下:这段代码应该是有问题的,变为选择ftp的目录了,而不是选择本地的目录上传。该怎么改一下呢才能实现上传本地的文件夹呢?

Dim dlg As New FolderBrowserDialog
If dlg.ShowDialog = DialogResult.OK Then
    Dim c As Col = CurrentTable.Cols(CurrentTable.ColSel)
    Dim ftp As FTPClient = c.DataCol.FTPClient
    If ftp.Upload(dlg.SelectedPath, "/ " & FileSys.GetName(dlg.SelectedPath)) Then
        CurrentTable.Current(c.Name) = "/ " & FileSys.GetName(dlg.SelectedPath)
    End If
End If

e.Form.Close


--  作者:有点甜
--  发布时间:2014/9/4 16:04:00
--  
 回复4楼,上传目录是很麻烦的,请使用自带的上传功能,不要自己做。
--  作者:狐狸爸爸
--  发布时间:2014/9/4 17:01:00
--  

遍历这个目录下的文件,逐个文件上传吧