let url = window.URL.createObjectURL(blob)
时间: 2023-11-11 11:53:17 浏览: 184
引用\[2\]中提到,window.URL.createObjectURL()可以直接生成blob:开头的链接,该链接产生于浏览器端,不会占用服务器资源。而在引用\[3\]中的代码中,使用了window.URL.createObjectURL()来生成一个blob链接,并将该链接赋值给变量url。所以,问题中的代码"let url = window.URL.createObjectURL(blob)"的作用是生成一个blob链接,并将其赋值给变量url。
#### 引用[.reference_title]
- *1* [【post请求下载文件流】如何使用post请求下载文件流 blob](https://blog.csdn.net/jmszl1991/article/details/108771559)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [window.URL.createObjectURL Blob URL无法在Microsoft IE和Edge中打开](https://blog.csdn.net/u013131203/article/details/80894440)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文