12-16-2019 02:00 AM
Hello,
I'm trying to get files from ftp. But I've some problems, all I test doesn't run...
I need to read periodically (each 30 seconds) a folder on ftp server (ftp://192.168.2.100/TRACA) to see if it is avoid or not, and what are he files names (I dont' know them per advance). If I find files, I have to move each file from ftp to local folder (C:\temp).
I hope there are some ftp functions to do it easily with LabVIEW, but I don't find them, or I use a bad syntax.
I work with LabVIEW 2018 SP1 on a Windows 10 Computer.
Thank you per advance for you help!
Francis
Solved! Go to Solution.
12-16-2019 06:00 AM - edited 12-16-2019 06:00 AM
Hello Cisco,
a good starting point is always the Example Finder. You can find it in the Help menu. There you can just open the 'search'- tab and type ftp. Try the shipped example.
12-16-2019 07:13 AM
Hello Dave,
Thank you, but I've checked examples without finding solution… I can' use the function "get file" (wich open the connexion, transfers file and closes connexion) because I need to discover files names; And it doesn't run… 😞
When it will ok, I think be able to copy files, but 've still Nothing find to delete files on ftp after copy...
12-16-2019 08:40 AM
Did you try the passive mode? I'm sitting behind a Firewall and this forces me to use the passive mode. The List Files- VI has an "Active"- Input too, it should be false then.
12-16-2019 09:40 AM
Thank you, it's much better like this! I can read the files list and do the copy.
My last problem is how to delete files on ftp after copy...
Greets,
12-16-2019 09:50 AM
I've finally find the delete function, in one of the 3 lvlib of "C:\Program Files (x86)\National Instruments\LabVIEW 218\vi.lib\FTP" (ftp 1.lvlib).
It's perfectly run, thank you Dave for your help! I post the code if it can help someone...
03-27-2023 10:09 PM
Dear Francis M,
You saved my life! Thank you so much for sharing a working code!!!
Wish you all the best!
Wendy
03-28-2023 02:40 AM
With pleasure! 🙂
03-28-2023 09:06 PM - edited 03-28-2023 09:07 PM
Dear Francis,
I have another question now...I'm good to get file from Remote with ASCII format, but got trouble with Binary, I simply turned binary to True on your code, and I then waited for a long time and I got nothing in my targeted folder. The reason I want to use binary is I found the size of files get from remote is different. the one I got, the size is bigger than the original one. My guess is it's included some returns...
Have you try to get a file or put a file with binary format? NI example doesn't work for me. The remote I have is not allowed mget/mput commands.
Best regards,
Wendy
03-29-2023 01:08 AM
Hello Wendy,
Sorry I haven't never tested this funtionnality, and I'm absolutely not a ftp specialist... What I've made has covered my requierements, then I've stopped the experimentation. In my case, the csv files I transfer do not seem to be modified.
Be carreful: in the help documentation, it's explain that "binary" specifies the transfer mode and not le files format mode.
"binary specifies whether to transfer data in binary or ASCII mode. The default is FALSE, in which the VI transfers data in ASCII mode."
Regards,
Francis