Index: /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/avx/router.py
===================================================================
--- /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/avx/router.py	(revision 9144)
+++ /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/avx/router.py	(working copy)
@@ -964,25 +964,42 @@
     return HttpResponse(json.dumps(response))
 
 def format_ftp_url(url):
-    result = cli_parse(url, RegexParser('ftp://(?P<user>[^:]+):(?P<passwd>[^@]+)@(?P<ip>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)(?P<port>:[0-9]+)?(?P<path>\S+)', MATCHONE, reflags=re.S))
+    protocol = 'sftp://' if url.startswith('sftp://') else 'ftp://'
+    # support no user and passwd ftp/sftp url
+    regex = protocol + r'(?:' \
+        r'(?P<user>[^:]+):(?P<passwd>[^@]+)@)?' \
+        r'(?P<ip>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)' \
+        r'(?P<port>:[0-9]+)?' \
+        r'(?P<path>\S+)'
+    result = cli_parse(url, RegexParser(regex, MATCHONE, reflags=re.S))
     res = {
         "status": False
     }
     if result:
-        if result["user"] and result["passwd"] and result["ip"] and result["path"]:
-            res["status"] = True
-            if "sftp://" in url:
-                port = "22" if not result["port"] else result["port"].split(":")[1]
-            else:
-                port = "21" if not result["port"] else result["port"].split(":")[1]
-            file_name = os.path.basename(urlsplit(result["path"]).path)
-
+        if not result["ip"] or not result["path"]:
+            return res
+        file_name = os.path.basename(urlsplit(result["path"]).path)
+        if not file_name or '.' not in file_name:
+            return res
+        default_port = "22" if url.startswith('sftp://') else "21"
+        port = default_port if not result["port"] else result["port"].split(":")[1]
+        res["status"] = True
+        if result["user"] and result["passwd"]:
             res["data"] = {
                 "user": result["user"],
                 "passwd": result["passwd"],
                 "ip": result["ip"],
                 "port": port,
                 "path": result["path"],
+                "file_name": file_name
+            }
+        else:
+            res["data"] = {
+                "user": "anonymous",
+                "passwd": '""',
+                "ip": result["ip"],
+                "port": port,
+                "path": result["path"],
                 "file_name": file_name
             }
     return res
Index: /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/download_ftp_image.py
===================================================================
--- /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/download_ftp_image.py	(revision 9144)
+++ /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/download_ftp_image.py	(working copy)
@@ -100,13 +100,13 @@
                 return (5,'login failed')
             else:
                 return (0, ftp)
-         
-    def download(self, remoteHost, remotePort, loginname, loginpassword, remotePath, localPath, fileName):
+
+    def download(self, remoteHost, remotePort, loginname, loginpassword, remotePath, localPath, file_name):
         #connect to the FTP Server and check the return
         res = self.ConnectFTP(remoteHost, remotePort, loginname, loginpassword)
         if(res[0]):
             record_error(file_name, res[0])
-             
+
         #change the remote directory and get the remote file size
         ftp = res[1]
         ftp.set_pasv(0)
Index: /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/download_sftp_image.py
===================================================================
--- /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/download_sftp_image.py	(revision 9144)
+++ /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/download_sftp_image.py	(working copy)
@@ -71,6 +71,8 @@
                         tmp_local_size = os.stat(local).st_size
                         percent = int(float(format(float(tmp_local_size) / float(remote_size),'.2f')) * 100)
                         record_progress(local_filename, tmp_local_size, remote_size, percent)
+                    final_local_size = os.stat(local).st_size
+                    record_progress(local_filename, final_local_size, remote_size, 100)
                 except Exception, e:
                     if f_remote:
                         f_remote.close()
