下载图片

 const downloadFile = (file, url) => {
      let fileName = parseTime(new Date());
      let fileType = getFileType(file);
      let a = document.createElement('a');
      a.href = url + '?response-content-type=application/octet-stream';
      a.download = `${fileName}${fileType}`;
      console.log('a.href', url);
      console.log('a.download', a.download);
      a.click();
    };
posted @ 2022-11-07 16:16  SultanST  阅读(37)  评论(0编辑  收藏  举报