Pman.Tab.FtpFiles.js
authorAlan Knowles <alan@akbkhome.com>
Mon, 15 Aug 2011 05:16:26 +0000 (13:16 +0800)
committerAlan Knowles <alan@akbkhome.com>
Mon, 15 Aug 2011 05:16:26 +0000 (13:16 +0800)
Pman.Tab.FtpFiles.js

index 3f787e1..b00f612 100644 (file)
@@ -182,7 +182,21 @@ Pman.Tab.FtpFiles = {
                             }
                             // if it's not a text file.. download it..
                             
-                            _this.viewLayout.load(baseURL+ '/Ftp/View' + s[0].data.id + '?html=1');
+                            var mt = s[0].data.mimetype;
+                            if (mt.match(/^text\//)) {
+                                _this.viewLayout.load(baseURL+ '/Ftp/View' + s[0].data.id + '?html=1');
+                                return;
+                            }
+                            if (mt.match(/\/xml$/)) {
+                                _this.viewLayout.load(baseURL+ '/Ftp/View' + s[0].data.id + '?html=1');
+                                return;
+                            }
+                            // download
+                            new Pman.Download({
+                                url: baseURL+ '/Ftp/View' + s[0].data.id;
+                            })
+                            
+                            
                         }
                     }
                 }