以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  FTP 自制窗口下载报错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=97239)

--  作者:douglas738888
--  发布时间:2017/3/8 15:24:00
--  FTP 自制窗口下载报错

请教老师,以下代码,报错【获取文件大小失败550,the system cannot find the path specified】下载失败

 

Dim r As Row = CurrentTable.Current
Dim ftp As new ftpclient
    ftp.host="*******"
    ftp.Port = 21
    ftp.account="******"
    ftp.password="*****"
   
If ftp.Download("\\wenjian\\" & r("相片"),"F:\\WJY\\" & r("相片"),True) = True Then

    Messagebox.show("下载完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
    Messagebox.show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If


--  作者:有点蓝
--  发布时间:2017/3/8 15:48:00
--  
服务路径不对

r("相片")是什么内容?

--  作者:有点色
--  发布时间:2017/3/8 16:09:00
--  

弹出

 

msgbox("\\wenjian\\" & r("相片"))


--  作者:douglas738888
--  发布时间:2017/3/8 16:26:00
--  

r("相片"))是列名      弹出 的是服务器上的\\wenjian\\//照片130.jpg                     服务器上有此文件存在


--  作者:有点蓝
--  发布时间:2017/3/8 17:03:00
--  

Dim name As String = r("相片").replace("//","")
If ftp.Download("\\wenjian\\" & name ,"F:\\WJY\\" & name ,True) = True Then
    Messagebox.show("下载完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
    Messagebox.show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If

--  作者:douglas738888
--  发布时间:2017/3/8 21:17:00
--  

还得请教老师,蓝老师指导的代码同样还是报错同样的问题,用系统自带的FTP下载没有问题,尝试用以下指定绝对路径的代码也报错同样的问题,无法下载

 

依照帮助上的绝对路径代码也是同样报错,无法找到指定的路径

Dim ftp As new FTPClient
    ftp.host="*********"
    ftp.Port = 21
    ftp.account="********"
    ftp.password="************"
    \'ftp.Connect
If ftp.Download("\\wenjian\\照片.jpg","f:\\wjy\\照片.jpg",True) = True Then
    Messagebox.show("下载完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
    Messagebox.show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If


--  作者:有点色
--  发布时间:2017/3/8 21:32:00
--  

改成这样测试

 

If ftp.Download("/wenjian/照片.jpg","d:\\test.jpg",True) = True Then

 

或者

 

If ftp.Download("/照片.jpg","d:\\test.jpg",True) = True Then


--  作者:douglas738888
--  发布时间:2017/3/8 22:37:00
--  

If ftp.Download("/照片.jpg","d:\\test.jpg",True) = True Then   这段代码可以下载,   老师那1楼的代码怎样调整才能正常


--  作者:有点色
--  发布时间:2017/3/8 23:38:00
--  

 

Dim r As Row = CurrentTable.Current
Dim ftp As new ftpclient
    ftp.host="*******"
    ftp.Port = 21
    ftp.account="******"
    ftp.password="*****"
   
If ftp.Download("/" & r("相片"),"F:\\WJY\\" & r("相片"),True) = True Then

    Messagebox.show("下载完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
    Messagebox.show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If