Js downloads cross-domain files if you avoid browsers opening them?

**osspdf,mp4,img**

a tag download these attributes only take effect when downloading files of the same domain
download.js has also been used, but none of the downloaded files can be opened

Jul.22,2021

sets the Content-Disposition in the header of the file http to attachment;filename= file name .


oss can set HTTP headers in batches. When you set Content-Disposition to attachment;, you can download instead of browse


function download(url, params) {
  let tempForm = document.createElement('form')
  tempForm.action = url
  tempForm.method = 'get'
  tempForm.style.display = 'none'
  for (var x in params) {
    let opt = document.createElement('textarea')
    opt.name = x
    opt.value = params[x]
    tempForm.appendChild(opt)
  }
  document.body.appendChild(tempForm)
  tempForm.submit()
  return tempForm
}
const url = 'ali-oss-object-url'
download(url)
.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b411ae-2bdbd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b411ae-2bdbd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?