diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index cd46570bd..91d4738d5 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -30,13 +30,12 @@ class Fileslistitem extends Component{ downloadfiles=(url,name)=>{ const aLink = document.createElement('a'); - document.body.appendChild(aLink); aLink.style.display='none'; aLink.download =name; aLink.href = url; + document.body.appendChild(aLink); aLink.click(); - document.body.removeChild(aLink); - + // document.body.removeChild(aLink); } showfiles=(value)=>{ let {discussMessage,coursesId}=this.props @@ -49,7 +48,7 @@ class Fileslistitem extends Component{ }).then((result)=>{ if(result.data.attachment_histories.length===0){ - this.downloadfiles(result.data.url,filesname) + this.downloadfiles(result.data.url,result.data.title) }else{ this.setState({ Showoldfiles:true,