If you need to save really large files bigger then the blob's size limitation or don't have
enough RAM, then have a look at the more advanced [StreamSaver.js][7]
that can save data directly to the hard drive asynchronously with the power of the new streams API. That will have
support for progress, cancelation and knowing when it's done writing
FileSaver.js
============
FileSaver.js is the solution to saving files on the client-side, and is perfect for
web apps that generates files on the client, However if the file is coming from the
server we recommend you to first try to use [Content-Disposition][8] attachment response header as it has more cross-browser compatiblity.
Looking for `canvas.toBlob()` for saving canvases? Check out
[canvas-toBlob.js][2] for a cross-browser implementation.
Supported Browsers
------------------
| Browser | Constructs as | Filenames | Max Blob Size | Dependencies |
| -------------- | ------------- | ------------ | ------------- | ------------ |
| Firefox 20+ | Blob | Yes | 800 MiB | None |
| Firefox < 20 | data: URI | No | n/a | [Blob.js](https://github.com/eligrey/Blob.js) |
| Chrome | Blob | Yes | [2GB][3] | None |
| Chrome for Android | Blob | Yes | [RAM/5][3] | None |
| Edge | Blob | Yes | ? | None |
| IE 10+ | Blob | Yes | 600 MiB | None |
| Opera 15+ | Blob | Yes | 500 MiB | None |
| Opera < 15 | data: URI | No | n/a | [Blob.js](https://github.com/eligrey/Blob.js) |
| Safari 6.1+* | Blob | No | ? | None |
| Safari < 6 | data: URI | No | n/a | [Blob.js](https://github.com/eligrey/Blob.js) |
| Safari 10.1+ | Blob | Yes | n/a | None |
Feature detection is possible:
```js
try {
var isFileSaverSupported = !!new Blob;
} catch (e) {}
```
### IE < 10
It is possible to save text files in IE < 10 without Flash-based polyfills.
See [ChenWenBrian and koffsyrup's `saveTextAs()`](https://github.com/koffsyrup/FileSaver.js#examples) for more details.
### Safari 6.1+
Blobs may be opened instead of saved sometimes—you may have to direct your Safari users to manually
press <kbd>⌘</kbd>+<kbd>S</kbd> to save the file after it is opened. Using the `application/octet-stream` MIME type to force downloads [can cause issues in Safari](https://github.com/eligrey/FileSaver.js/issues/12#issuecomment-47247096).
### iOS
saveAs must be run within a user interaction event such as onTouchDown or onClick; setTimeout will prevent saveAs from triggering. Due to restrictions in iOS saveAs opens in a new window instead of downloading, if you want this fixed please [tell Apple how this WebKit bug is affecting you](https://bugs.webkit.org/show_bug.cgi?id=167341).
Syntax
------
### Import `saveAs()` from file-saver
```js
import { saveAs } from 'file-saver';
```
```js
FileSaver saveAs(Blob/File/Url, optional DOMString filename, optional Object { autoBom })
```
Pass `{ autoBom: true }` if you want FileSaver.js to automatically provide Unicode text encoding hints (see: [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark)). Note that this is only done if your blob type has `charset=utf-8` set.
Examples
--------
### Saving text using `require()`
```js
var FileSaver = require('file-saver');
var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
FileSaver.saveAs(blob, "hello world.txt");
```
### Saving text
```js
var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
FileSaver.saveAs(blob, "hello world.txt");
```
### Saving URLs
```js
FileSaver.saveAs("https://httpbin.org/image", "image.jpg");
```
Using URLs within the same origin will just use `a[download]`.
Otherwise, it will first check if it supports cors header with a synchronous head request.
If it does, it will download the data and save using blob URLs.
If not, it will try to download it using `a[download]`.
The standard W3C File API [`Blob`][4] interface is not available in all browsers.
[Blob.js][5] is a cross-browser `Blob` implementation that solves this.
### Saving a canvas
```js
var canvas = document.getElementById("my-canvas");
canvas.toBlob(function(blob) {
saveAs(blob, "pretty image.png");
});
```
Note: The standard HTML5 `canvas.toBlob()` method is not available in all browsers.
[canvas-toBlob.js][6] is a cross-browser `canvas.toBlob()` that polyfills this.
### Saving File
You can save a File constructor without specifying a filename. If the
file itself already contains a name, there is a hand full of ways to get a file
instance (from storage, file input, new constructor, clipboard event).
If you still want to change the name, then you can change it in the 2nd argument.
```js
// Note: Ie and Edge don't support the new File constructor,
// so it's better to construct blobs and use saveAs(blob, filename)
var file = new File(["Hello, world!"], "hello world.txt", {type: "text/plain;charset=utf-8"});
FileSaver.saveAs(file);
```
![Tracking image](https://in.getclicky.com/212712ns.gif)
[1]: http://eligrey.com/demos/FileSaver.js/
[2]: https://github.com/eligrey/canvas-toBlob.js
[3]: https://bugs.chromium.org/p/chromium/issues/detail?id=375297#c107
[4]: https://developer.mozilla.org/en-US/docs/DOM/Blob
[5]: https://github.com/eligrey/Blob.js
[6]: https://github.com/eligrey/canvas-toBlob.js
[7]: https://github.com/jimmywarting/StreamSaver.js
[8]: https://github.com/eligrey/FileSaver.js/wiki/Saving-a-remote-file#using-http-header
Installation
------------------
```bash
# Basic Node.JS installation
npm install file-saver --save
bower install file-saver
```
Additionally, TypeScript definitions can be installed via:
```bash
# Additional typescript definitions
npm install @types/file-saver --save-dev
```
没有合适的资源?快使用搜索试试~ 我知道了~
java毕业设计 基于SpringBoot+Mybatis的四六级报名系统的设计与实现+详细文档+全部资料+数据库(优秀项目)
共307个文件
xml:94个
js:40个
java:24个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 101 浏览量
2024-04-17
10:49:13
上传
评论
收藏 11.58MB ZIP 举报
温馨提示
【资源说明】 java毕业设计 基于SpringBoot+Mybatis的四六级报名系统的设计与实现+详细文档+全部资料+数据库(优秀项目).zipjava毕业设计 基于SpringBoot+Mybatis的四六级报名系统的设计与实现+详细文档+全部资料+数据库(优秀项目).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕设项目、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 3、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
java毕业设计 基于SpringBoot+Mybatis的四六级报名系统的设计与实现+详细文档+全部资料+数据库(优秀项目) (307个子文件)
ExportController.class 5KB
StudentController.class 5KB
LoginController.class 4KB
StudentService.class 3KB
CetTimeController.class 2KB
LoginService.class 2KB
CetController.class 2KB
ExportUtil.class 2KB
StudentMapper.class 2KB
NoticeController.class 2KB
LoginMapper.class 2KB
IframeController.class 2KB
CetService.class 1KB
IframeService.class 1KB
ResultData.class 1KB
CetTimeService.class 1KB
NoticeService.class 1KB
CetMapper.class 778B
CetTimeMapper.class 753B
CxhApplication.class 726B
IframeMapper.class 703B
NoticeMapper.class 619B
CxhApplicationTests.class 524B
mvnw.cmd 6KB
bootstrap.css 170KB
bootstrap.css 170KB
bootstrap.min.css 138KB
bootstrap.min.css 138KB
style.css 58KB
style.css 58KB
font-awesome.min.css 30KB
font-awesome.min.css 30KB
notiflix.css 21KB
notiflix.css 21KB
new_file.css 2KB
new_file.css 2KB
bs4.pop.css 682B
bs4.pop.css 682B
fontawesome-webfont.eot 162KB
fontawesome-webfont.eot 162KB
themify.eot 77KB
themify.eot 77KB
Pe-icon-7-stroke.eot 57KB
Pe-icon-7-stroke.eot 57KB
icomoon.eot 5KB
icomoon.eot 5KB
index.html 8KB
index.html 8KB
adminexatime.html 5KB
adminexatime.html 5KB
iframe.html 4KB
iframe.html 4KB
admincetfour.html 4KB
admincetfour.html 4KB
admincetsix.html 4KB
admincetsix.html 4KB
login.html 3KB
login.html 3KB
persionInfo.html 3KB
persionInfo.html 3KB
adminnotice.html 3KB
adminnotice.html 3KB
fourEnglish.html 2KB
fourEnglish.html 2KB
sixEnglish.html 2KB
sixEnglish.html 2KB
updatePwd.html 2KB
updatePwd.html 2KB
index.html 0B
index.html 0B
cxh-english.iml 11KB
maven-wrapper.jar 50KB
MavenWrapperDownloader.java 5KB
ExportController.java 5KB
StudentController.java 4KB
LoginController.java 3KB
StudentService.java 3KB
StudentMapper.java 2KB
CetController.java 2KB
LoginService.java 2KB
ExportUtil.java 2KB
CetTimeController.java 2KB
LoginMapper.java 2KB
IframeController.java 1KB
NoticeController.java 1KB
CetService.java 1KB
IframeService.java 904B
CetTimeService.java 837B
NoticeService.java 833B
ResultData.java 759B
CetMapper.java 717B
CetTimeMapper.java 627B
NoticeMapper.java 590B
IframeMapper.java 560B
CxhApplication.java 313B
CxhApplicationTests.java 212B
shouye.jpg 156KB
shouye.jpg 156KB
zhifu.jpg 136KB
zhifu.jpg 136KB
共 307 条
- 1
- 2
- 3
- 4
资源评论
不走小道
- 粉丝: 3217
- 资源: 5111
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
- 基于Java和LCN分布式事务框架的设计源码 - tx-lcn
- 基于Java和JavaScript的茶叶评级管理系统设计源码 - tea
- IMG_5680.JPG
- IMG_0437.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功