Copy link to clipboard
Copied
I have established an SFTP connection with a client site but I cannot see the files in the directory because they do not have valid extensions. If I upload a file to the directory and add .txt to the end cfftp sees the file just fine but ignores all other files in the directory.
Is there a way to view all contents of a directory regardless of MIME type?
Copy link to clipboard
Copied
Hello,
you can perform a listDir action.
ftpService = new FTP();
ftpService.setServer('your.server.com');
ftpService.setUserName('username');
ftpService.setSecure(true); // SFTP connection
ftpService.setPassword('passowrd');
ftpService.setDirectory('/') // for root
fileList = ftpService.listDir();
then, dump fileList and I think you'll find happiness.
Hope it helps
Copy link to clipboard
Copied
Haha, thanks. Did not exactly answer the question, which you may note was posted 3 years ago. Unfortunately I cannot remember what I did to fix the issue or even which client I was working on this for. I guess it is never too late for a good follow up.