mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-09-11 08:55:32 +03:00
Fixed file.bin download name
This commit is contained in:
parent
b53867ef93
commit
4bb9a65eec
@ -296,7 +296,7 @@ module.exports.CreateMeshDeviceFile = function (parent, ws, res, req, domain, us
|
|||||||
function setContentDispositionHeader(res, type, name, size, altname) {
|
function setContentDispositionHeader(res, type, name, size, altname) {
|
||||||
if (name != null) { name = require('path').basename(name).split('\\').join('').split('/').join('').split(':').join('').split('*').join('').split('?').join('').split('"').join('').split('<').join('').split('>').join('').split('|').join('').split('\'').join(''); } else { name = altname; }
|
if (name != null) { name = require('path').basename(name).split('\\').join('').split('/').join('').split(':').join('').split('*').join('').split('?').join('').split('"').join('').split('<').join('').split('>').join('').split('|').join('').split('\'').join(''); } else { name = altname; }
|
||||||
try {
|
try {
|
||||||
var x = { 'Cache-Control': 'no-store', 'Content-Type': type, 'Content-Disposition': 'attachment; filename*="' + encodeURIComponent(name) + '"; filename="' + altname + '"' };
|
var x = { 'Cache-Control': 'no-store', 'Content-Type': type, 'Content-Disposition': 'attachment; filename="' + encodeURIComponent(name) + '"' };
|
||||||
if (typeof size == 'number') { x['Content-Length'] = size; }
|
if (typeof size == 'number') { x['Content-Length'] = size; }
|
||||||
res.set(x);
|
res.set(x);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
File diff suppressed because one or more lines are too long
@ -6712,7 +6712,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||||||
function setContentDispositionHeader(res, type, name, size, altname) {
|
function setContentDispositionHeader(res, type, name, size, altname) {
|
||||||
var name = require('path').basename(name).split('\\').join('').split('/').join('').split(':').join('').split('*').join('').split('?').join('').split('"').join('').split('<').join('').split('>').join('').split('|').join('').split('\'').join('');
|
var name = require('path').basename(name).split('\\').join('').split('/').join('').split(':').join('').split('*').join('').split('?').join('').split('"').join('').split('<').join('').split('>').join('').split('|').join('').split('\'').join('');
|
||||||
try {
|
try {
|
||||||
var x = { 'Cache-Control': 'no-store', 'Content-Type': type, 'Content-Disposition': 'attachment; filename*="' + encodeURIComponent(name) + '"; filename="' + altname + '"' };
|
var x = { 'Cache-Control': 'no-store', 'Content-Type': type, 'Content-Disposition': 'attachment; filename="' + encodeURIComponent(name) + '"' };
|
||||||
if (typeof size == 'number') { x['Content-Length'] = size; }
|
if (typeof size == 'number') { x['Content-Length'] = size; }
|
||||||
res.set(x);
|
res.set(x);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user