diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js
index 67c4be047..2766ee957 100644
--- a/web/pgadmin/misc/file_manager/static/js/utility.js
+++ b/web/pgadmin/misc/file_manager/static/js/utility.js
@@ -52,6 +52,18 @@ define([
     });
   };
 
+  var getFileFormat = function(data) {
+  // Get last selected file format
+    return $.ajax({
+      async: false,
+      cache: false,
+      url: url_for('settings.get_file_format_setting'),
+      data : $.extend({}, data),
+      dataType: 'json',
+      contentType: 'application/json; charset=utf-8',
+    });
+  };
+
   // Set enable/disable state of list and grid view
   var setViewButtonsFor = function(viewMode) {
     if (viewMode == 'grid') {
@@ -1330,18 +1342,22 @@ define([
         if (types_len > 0) {
           var i = 0,
             t,
-            selected = false,
             have_all_types = false;
 
           let fileFormats = '';
+          let response = getFileFormat(config.options.allowed_file_types);
+          let lastSelectedFormat =  response.responseJSON.info;
+
           while (i < types_len) {
             t = allowed_types[i];
-            if (!selected && (types_len == 1 || t != '*')) {
-              fileFormats += '<option value=' + t + ' selected>' + t + '</option>';
-              selected = true;
+            if ((types_len == 1 || t != '*')) {
+              if(t === lastSelectedFormat)
+                fileFormats += '<option value=' + t + ' selected >' + t + '</option>';
+              else
+                fileFormats += '<option value=' + t + ' >' + t + '</option>';
               have_all_types = (have_all_types || (t == '*'));
-            } else {
-              fileFormats += '<option value="' + t + '">' +
+            } else if ((lastSelectedFormat === '*')) {
+              fileFormats += '<option value="' + t + '" selected >' +
                 (t == '*' ? gettext('All Files') : t) + '</option>';
               have_all_types = (have_all_types || (t == '*'));
             }
@@ -1370,6 +1386,13 @@ define([
             curr_path = $('.currentpath').val(),
             user_input_file = null,
             input_path = $('.storage_dialog #uploader .input-path').val();
+          config.options.selectedFormat = selected_val;
+          $.ajax({
+            url: url_for('settings.save_file_format_setting'),
+            type: 'POST',
+            contentType: 'application/json',
+            data: JSON.stringify(config.options),
+          });
           if (curr_path.endsWith('/')) {
             user_input_file = input_path.substring(curr_path.lastIndexOf('/')+1);
           } else {
@@ -1928,10 +1951,15 @@ define([
     getDetailView: function(path) {
       if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
         var allowed_types = this.config.options.allowed_file_types;
-        var set_type = allowed_types[0];
-        if (allowed_types[0] == '*') {
-          set_type = allowed_types[1];
-        }
+
+        let set_type;
+
+        let response = getFileFormat(this.config.options.allowed_file_types);
+        let lastSelectedFormat =  response.responseJSON.info;
+        if (_.isUndefined(lastSelectedFormat))
+          set_type = allowed_types[0];
+        else
+          set_type = lastSelectedFormat;
         getFolderInfo(path, set_type);
       }
     },
diff --git a/web/pgadmin/settings/__init__.py b/web/pgadmin/settings/__init__.py
index c49feea41..9723f9af9 100644
--- a/web/pgadmin/settings/__init__.py
+++ b/web/pgadmin/settings/__init__.py
@@ -57,7 +57,9 @@ class SettingsModule(PgAdminModule):
         return [
             'settings.store', 'settings.store_bulk', 'settings.reset_layout',
             'settings.save_tree_state', 'settings.get_tree_state',
-            'settings.reset_tree_state'
+            'settings.reset_tree_state',
+            'settings.save_file_format_setting',
+            'settings.get_file_format_setting'
         ]
 
 
@@ -218,3 +220,66 @@ def get_browser_tree_state():
     return Response(response=data,
                     status=200,
                     mimetype="application/json")
+
+
+def _get_dialog_type(file_type):
+    """
+    This function return dialog type
+    :param file_type:
+    :return: dialog type.
+    """
+    if 'pgerd' in file_type:
+        return 'erd_file_type'
+    elif 'backup' in file_type:
+        return 'backup_file_type'
+    elif 'csv' in file_type and 'txt' in file_type:
+        return 'import_export_file_type'
+    elif 'csv' in file_type and 'txt' not in file_type:
+        return 'storage_manager_file_type'
+    else:
+        return 'sqleditor_file_format'
+
+
+@blueprint.route("/save_file_format_setting/",
+                 endpoint="save_file_format_setting",
+                 methods=['POST'])
+@login_required
+def save_file_format_setting():
+    """
+    This function save the selected file format.
+    :return: save file format response
+    """
+    data = request.form if request.form else json.loads(
+        request.data.decode('utf-8'))
+    file_type = _get_dialog_type(data['allowed_file_types'])
+
+    store_setting(file_type, data['selectedFormat'])
+    return make_json_response(success=True,
+                              info=data,
+                              result=request.form)
+
+
+@blueprint.route("/get_file_format_setting/",
+                 endpoint="get_file_format_setting",
+                 methods=['GET'])
+@login_required
+def get_file_format_setting():
+    """
+    This function return the last selected file format
+    :return: last selected file format
+    """
+    data = dict()
+    for k, v in request.args.items():
+        try:
+            data[k] = json.loads(v, encoding='utf-8')
+        except ValueError:
+            data[k] = v
+
+    file_type = _get_dialog_type(list(data.values()))
+
+    data = Setting.query.filter_by(
+        user_id=current_user.id, setting=file_type).first()
+    if data is None:
+        return make_json_response(success=True, info='*')
+    else:
+        return make_json_response(success=True, info=data.value)
