From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open File Dialog, Select either FIle or Folder, but Set the Initial Location to ftp://

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 filepath with ftp address.png. 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).

dotNet FileDialog.png

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.

filedialog express vi options.png

 

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?

0 Kudos
Message 1 of 3
(3,314 Views)

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.

 

 

ftp.png

---
CLA
0 Kudos
Message 2 of 3
(3,284 Views)

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.

0 Kudos
Message 3 of 3
(3,278 Views)