Index: /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/avx/models/system/system_mgmt/__init__.py
===================================================================
--- /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/avx/models/system/system_mgmt/__init__.py	(revision 9143)
+++ /branches/rel_avx_2_7_5/src/webui/webui/htdocs/new/src/avx/models/system/system_mgmt/__init__.py	(working copy)
@@ -293,19 +293,43 @@
                 'url': ImportURLField(verbose_name=_('URL'))
                 }),
         )
-          
+
     class Meta:
         profile = True
         verbose_name = _('System Update')
         show_im_export_button = False
-    
+
     class Manager(CLIManager):
         def _get_query_set(self):
             return QuerySet(self._model, [{}])
-        
+
+        def _ensure_safe_filename(self, file_path):
+            if not os.path.exists(file_path):
+                return file_path
+
+            dirname = os.path.dirname(file_path)
+            safe_filename = "avx_upgrade_temp.array"
+            safe_path = os.path.join(dirname, safe_filename)
+
+            if file_path == safe_path:
+                return safe_path
+
+            try:
+                if os.path.exists(safe_path):
+                    os.remove(safe_path)
+                os.rename(file_path, safe_path)
+                andebug('hive.debug', 'Renamed upgrade file to safe path: %s' % safe_path)
+                return safe_path
+            except OSError as e:
+                andebug('hive.debug', 'Failed to rename upgrade file: %s' % str(e))
+                return file_path
+
         def _perform_Update(self, options):
             andebug('hive.debug', 'system update...')
             upload_file = options['using'].values()[0]
+
+            upload_file = self._ensure_safe_filename(upload_file)
+
             self.cli.set_config()
             ret = self.cli.cmd('system update "%s" %s\nYES\n' % (upload_file, options['option']),timeout=600.0)
             msg = ret.split('\n')[-2]
