mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
Download mission file
This commit is contained in:
parent
76c05d9c7d
commit
11150bc59b
@ -1,5 +1,5 @@
|
|||||||
<td>
|
<td>
|
||||||
<a href='#missions/<%-name%>'><%-name%></a>
|
<a href='/api/missions/<%-name%>'><%-name%></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="btn btn-danger btn-xs delete">
|
<button type="button" class="btn btn-danger btn-xs delete">
|
||||||
|
@ -21,7 +21,6 @@ exports.create = function(req, res){
|
|||||||
|
|
||||||
fs.readFile(missionFile.path, function (err, data) {
|
fs.readFile(missionFile.path, function (err, data) {
|
||||||
var newPath = config.path + '/mpmissions/' + missionFile.name;
|
var newPath = config.path + '/mpmissions/' + missionFile.name;
|
||||||
console.log(newPath);
|
|
||||||
fs.writeFile(newPath, data, function (err) {
|
fs.writeFile(newPath, data, function (err) {
|
||||||
res.json(missionFile);
|
res.json(missionFile);
|
||||||
});
|
});
|
||||||
@ -29,7 +28,13 @@ exports.create = function(req, res){
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.show = function(req, res){
|
exports.show = function(req, res){
|
||||||
res.send('download mission ' + req.params.mission);
|
var path = config.path + '/mpmissions/' + req.params.mission;
|
||||||
|
|
||||||
|
if (req.params.format) {
|
||||||
|
path += '.' + req.params.format;
|
||||||
|
}
|
||||||
|
|
||||||
|
res.download(path);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.destroy = function(req, res){
|
exports.destroy = function(req, res){
|
||||||
|
Loading…
Reference in New Issue
Block a user