fix download file

This commit is contained in:
Paul Sori 2018-11-21 02:43:25 -05:00
parent 93d4041dc8
commit 3d0a0deaeb
3 changed files with 5 additions and 9 deletions

View File

@ -247,6 +247,7 @@ ul.jp-controls li {
list-style-type: none !important; }
#downform {
display: none;
position: absolute; }
.controls div {

View File

@ -90,11 +90,8 @@ var VUEPLAYER = (function () {
MSTREAMPLAYER.removeSongAtPosition(this.index, false);
},
downloadSong: function (event) {
$("#downform2").attr("action", "/media/" + this.song.filepath + "?token=" + MSTREAMAPI.currentServer.token);
//submit form
$('#downform2').submit();
// clear the form
$('#downform2').empty();
$("#download-file").attr("href", "/media/" + this.song.filepath + "?token=" + MSTREAMAPI.currentServer.token);
document.getElementById('download-file').click();
},
createPopper: function (event) {
if (currentPopperSongIndex === this.index) {

View File

@ -139,12 +139,10 @@
<!-- Download iFrame -->
<form id="downform" action="" target="frameframe" method="POST"></form>
<iframe id="downframe" src="" width="0" height="0" tabindex="-1" title="empty" class="hidden" hidden name="frameframe"></iframe>
<iframe id="downframe" src="" width="0" height="0" tabindex="-1" title="empty" hidden name="frameframe"></iframe>
<!-- Download iFrame for GET requests -->
<form id="downform2" action="" target="frameframe2" method="GET"></form>
<iframe id="downframe2" src="" width="0" height="0" tabindex="-1" title="empty" class="hidden" hidden name="frameframe2"></iframe>
<a href="#" class="hide" download id="download-file" hidden></a>
<div class="off-canvas-wrap">
<div class="inner-wrap">