Method similler to File.Exists() for this componet (General questions)
Hi,
I want to check the existance of the file on ftpfolder. I tried the File.Exists(FTPFolderath) but it won't work. Is this component have similler method which I can use. Thnaks
Re: Method similler to File.Exists() for this comp
Forgot to mention that I am taking about the wodFtpDLX.NET
Hi,
I want to check the existance of the file on ftpfolder. I tried the File.Exists(FTPFolderath) but it won't work. Is this component have similler method which I can use. Thnaks
Re: Method similler to File.Exists() for this comp
Hi,
Unfortunately, method like that doesn't exsist. Hovever, i would suggest that you try listing a directory and check if a file exist or not.
You can do that, either by using diritems collection, or using loopfiles method and loopitems event.
Can you please try one of these methods?
Regards,
Damba
Re: Method similler to File.Exists() for this comp
Thanks !!
It would be great help if you could tell me how to use diritems ,loopfiles or ListDir.
Re: Method similler to File.Exists() for this comp
Hi,
Ok, ListDir is used by simply providing is remotepath. Something like this:
[code]wodFtp1.ListDir /home/user/ [/code]
This method will list all the files and directories in that path. Also, as a result it will fire ListItems event,which will provide you directory listing as String.
More information here: http://www.weonlydo.com/FtpDLX/Help/wodFtpDLXLib~wodFtpDLX~ListItems_EV.html
As a result of ListDir method, DirItems collection is also populated with all the files/directories. You can then iterate thru each of them, something like this:
[code]Dim folderItem as DirItem
For each folderItem in wodFtp1.DirItems
Debug.Print folderItem.Name
Next[/code]
LoopFiles also accepts remotepath parameter. However, as a result of this method, LoopItem event is fired for each item (directory, file etc.). Using this event, you can use RemoteFile parameter to check if this is the file you are looking for.
You can find more information on this event here: http://www.weonlydo.com/FtpDLX/Help/wodFtpDLXLib~wodFtpDLX~LoopFiles.html
Hope this helps.
Regards,
Damba