如何使用本地存储从 html5 存储或 JQuery 下载二进制/视频文件

发布于 2024-11-08 21:31:56 字数 259 浏览 0 评论 0原文

我读了很多关于 JQuery、html5 LocalStorage 的文章,但我还没有得到我想要的。

这是我的疑问:我有一些属于视频一部分的网址(格式无关紧要),我想将这些文件下载为 cookie 或临时文件,无论它们是否保存为二进制文件,或者电影文件。

我知道可以下载字符串并将其保存为cookie。但是,我该怎么做呢?

我也一直在看 JQuery lib,但我还做不到。

任何帮助将不胜感激。

我最诚挚的问候, 安东尼奥

I have been reading so much articles about JQuery, html5 LocalStorage but I could not get what I want yet.

This is my doubt: I have some url that are part of a video (the format does not matter) and I would like to download those files as cookies or as temporally files, it does not matter if they are save as binary file, or movie file.

I know that is possible to download string and save it as cookies. But, how can I do this?

I have also been looking at JQuery lib, but I could not do it yet.

Any help would be appreciate.

My best regards,
Antonio

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅语花开 2024-11-15 21:31:56

我知道这确实很旧,但我自己查找这个问题的答案并发现了这一点:

HTML5 存储不允许您存储二进制数据。因此,如果您想存储视频,则需要将整个视频编码为 Base64,然后将其存储为文本。

I know this is really old but I was looking up the answer to this question myself and found this out:

HTML5 storage does not allow you to store binary data. So if you wanted to store a video you would need to encode the entire video into Base64 and then store it as text.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文