mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that JSON files should be downloaded properly from the storage manager. Fixes #7118
This commit is contained in:
committed by
Akshay Joshi
parent
04729f63b8
commit
deab1bfaba
@@ -1222,7 +1222,9 @@ class Filemanager(object):
|
||||
else:
|
||||
dir_path = os.path.dirname(path)
|
||||
|
||||
response = send_from_directory(dir_path, name, as_attachment=True)
|
||||
response = send_from_directory(dir_path, name,
|
||||
mimetype='application/octet-stream',
|
||||
as_attachment=True)
|
||||
response.headers["filename"] = name
|
||||
|
||||
return response
|
||||
|
||||
@@ -9,19 +9,12 @@
|
||||
|
||||
"""A blueprint module implementing the storage manager functionality"""
|
||||
|
||||
import simplejson as json
|
||||
import os
|
||||
|
||||
from flask import url_for, Response, render_template, request, current_app
|
||||
from flask import url_for, Response, render_template
|
||||
from flask_babel import gettext as _
|
||||
from flask_security import login_required, current_user
|
||||
from pgadmin.misc.bgprocess.processes import BatchProcess, IProcessDesc
|
||||
from pgadmin.utils import PgAdminModule, get_storage_directory, html, \
|
||||
fs_short_path, document_dir, IS_WIN, does_utility_exist
|
||||
from pgadmin.utils.ajax import make_json_response, bad_request
|
||||
from flask_security import login_required
|
||||
|
||||
from config import PG_DEFAULT_DRIVER
|
||||
from pgadmin.model import Server
|
||||
from pgadmin.utils import PgAdminModule
|
||||
from pgadmin.utils.ajax import bad_request
|
||||
from pgadmin.utils.constants import MIMETYPE_APP_JS
|
||||
|
||||
MODULE_NAME = 'storage_manager'
|
||||
|
||||
Reference in New Issue
Block a user