Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.9k views
by (200 points)
OK, I did a few different searches in the Integral forum and didn't see anything on this - so if I am wrong, pardon the duplicate thread.

I am trying to hide the files that typically start with a . on UNIX type systems with the exception of the . and .. for folders. Has anyone done this or can someone give some tips? I was looking in directory list event but it seems 'files' as a object is already there. Would I need to parse that variable's data and remove anything I don't want before it refreshes the folder or is there a better way?

Thanks,

K.

4 Answers

0 votes
by (51.6k points)
In remotefilelist.js you'll find the following lines (around line 26):
renderer.renderFileName = function(fileName, filePath, isTextFile) {
    var safeFileName = fileName.replace(/\\/g, "\\\\").replace(/\'/g, "\\\'");

You should be able to add an if-statement after this to check if the file-name starts with "." and just return if it does.

I haven't tested this, but it would be something like:
renderer.renderFileName = function(fileName, filePath, isTextFile) {
    var safeFileName = fileName.replace(/\\/g, "\\\\").replace(/\'/g, "\\\'");
    if (safeFileName.indexOf(".")==0)
       return;


Please let me know how that goes.

- Hans (EnterpriseDT)
0 votes
by (200 points)
Its close - it does hide the file name and the images for download, etc but it still displays the bytes and the date. That's on any browser.

Thanks,

K
0 votes
by (51.6k points)
Yes, now that you say it, it's pretty obvious to me that that would happen.

Please delete the code that I asked you to add in my first reply.

Instead, just under the line
renderer.showSeconds = false;

add this code:
renderer.renderFile = function(file) {
   if (file.name.indexOf(".")==0)
      return;
   this.document.writeln("<tr>");
   this.renderFileName(file.name, file.path, file.isTextFile);
   this.renderFileSize(new FTPFileSize(file.size));
   this.renderFileDate(file.modifiedDate);
   this.document.writeln("</tr>");
};


I've tested it this time and it works. I'm sorry I was lazy. I should've tested my first attempt.

- Hans (EnterpriseDT)
0 votes
by (200 points)
Worked like a charm of course! Thanks!

Categories

...