|
|
|
@ -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,
|
|
|
|
|