下载文件如mega.co.nz [英] Download files like mega.co.nz
问题描述
例如在下载页面中,它将在浏览器上下载文件,然后用javascript解密它们。
例如看到此链接下载png文件: / p>
https://mega.co.nz/#!7JRgFJzJ! efpJGWuPhYczLexY19ex82nuwfs4sR_DG4JXddeClH4
在此链接中,它将在浏览器中开始下载。我检查了网络标签在检查元素,它将下载部分的文件与AJAX完成文件的所有部分后,将其全部保存在计算机上的一个文件自动!
我想知道他们在做什么?您可以解释或链接一些关于浏览器中的下载文件的资源吗?
也可以使用javascript或者应该使用一些Flash插件或类似的东西? / p>
Mega使用几种不同的方法:(截至2013年11月27日)
- Filesystem API (Chrome / Firefox Extension polyfill)
- Adobe Flash SWF Filewriter(旧浏览器回退)
- BlobBuilder (IE10 / IE11)
- MEGA Firefox扩展(不推荐)
- Arraybuffer / Blob(内存中)+ a [download] (用于支持[下载]的浏览器)
- MediaSource的 (实验流解决方案)
- 存储在IndexedDB存储中的Blob + 一个[下载] (Firefox 20+,改进了内存中的Blob方法)
来源: https://eu.static.mega.co.nz/js/download_6.js)
Today i checked mega.co.nz and i'm excited about some features. for example in download page it will download files on browser and after that decrypt them with javascript.
for example see this link to download a png file :
https://mega.co.nz/#!7JRgFJzJ!efpJGWuPhYczLexY19ex82nuwfs4sR_DG4JXddeClH4
in this link it will start the download inside the browser. i checked network tab in inspect element it will download parts of file with AJAX after that completed all parts of file, will save all of them in one file on computer automatically!
i want to know what they do? can you explain or link to some resource about download files inside browser like that?
also can done it only with javascript or should use some flash plugins or something like that?
Mega uses several different methods to do this: (as of 27 Nov 2013)
- Filesystem API (Chrome/Firefox Extension polyfill)
- Adobe Flash SWF Filewriter (old browsers fallback)
- BlobBuilder (IE10/IE11)
- MEGA Firefox Extension (deprecated)
- Arraybuffer/Blob (in memory) + a[download] (for browsers that support a[download])
- MediaSource (experimental streaming solution)
- Blob stored in IndexedDB storage + a[download] (Firefox 20+, improvement over the in-memory Blob method)
(source: https://eu.static.mega.co.nz/js/download_6.js)
这篇关于下载文件如mega.co.nz的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!