下载文件如mega.co.nz [英] Download files like mega.co.nz

查看:195
本文介绍了下载文件如mega.co.nz的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我检查了mega.co.nz,我对某些功能感到兴奋。
例如在下载页面中,它将在浏览器上下载文件,然后用javascript解密它们。



例如看到此链接下载png文件: / p>

https://mega.co.nz/#!7JRgFJzJ! efpJGWuPhYczLexY19ex82nuwfs4sR_DG4JXddeClH4



在此链接中,它将在浏览器中开始下载。我检查了网络标签在检查元素,它将下载部分的文件与AJAX完成文件的所有部分后,将其全部保存在计算机上的一个文件自动!



我想知道他们在做什么?您可以解释或链接一些关于浏览器中的下载文件的资源吗?



也可以使用javascript或者应该使用一些Flash插件或类似的东西? / p>

解决方案

Mega使用几种不同的方法:(截至2013年11月27日)


  1. Filesystem API (Chrome / Firefox Extension polyfill)

  2. Adob​​e Flash SWF Filewriter(旧浏览器回退)

  3. BlobBuilder (IE10 / IE11)

  4. MEGA Firefox扩展(不推荐)

  5. Arraybuffer / Blob(内存中)+ a [download] (用于支持[下载]的浏览器)

  6. MediaSource的 (实验流解决方案)

  7. 存储在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)

  1. Filesystem API (Chrome/Firefox Extension polyfill)
  2. Adobe Flash SWF Filewriter (old browsers fallback)
  3. BlobBuilder (IE10/IE11)
  4. MEGA Firefox Extension (deprecated)
  5. Arraybuffer/Blob (in memory) + a[download] (for browsers that support a[download])
  6. MediaSource (experimental streaming solution)
  7. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆