03-12-2014 10:54 AM - edited 03-12-2014 11:24 AM
Hello,
I want to be able to open a file dialog, set the initial location to an ftp:// address, and allow the user to select individual files or a directory.
I can use the File Dialog express VI, and wire in a start path, but the problem is that the filepath constant does not allow you to input ftp://[IPAddress]. If you type it in it will automatically adjust the path to read . If you right click, and hit browse and go to an ftp site, the dialog will not let you select a file or folder. And no you cannot type the address into a string and then convert that to a path. If you do it will look just like the image above.
I can use .NET functions as seen below, but it is not trivial to allow the user to select files or a folder. The same is true if I write it in C++ (although I haven't tried this yet, just googled selecting files or folders in a file dialog).
EDIT: I just realized that with .NET if I select a single file, the FileName it returns points to a temporary internet folder on my computer for example: C:\Users\xxxxx\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\P01ODP0F\ni-rt[1].ini
The FileDIalog Express VI has these very options.
So what is the easiest way to have an initial ftp address path for a file dialog, and allow the user to select files or a folder?
03-12-2014 12:04 PM
Have never had to do that before - that's a bit of a drag.
Some thoughts.
1) Can you map a drive to that FTP address and go from there?
2) You could try rolling your own dialog via FTP - that's something I've definitely done before!
In the following snippet, I start an FTP session on the NI FTP site, log in as anonymous, list the base directory files/folders and then close my session. I then unbundle the directory listings array and plug the name and item type into the item names of a multicolumn listbox.
03-12-2014 12:08 PM
In the end I think I'll end up doing something like this. Although I might use a tree instead of a listbox. But it is strange that this is so difficult. I'm thinking it might be a windows thing though.