如何使用jquery在本地存储中存储文件

时间:2022-03-25 16:32:18

I would like to store uploaded files locally(local-storage) using jquery can anyone help me

我想使用jquery本地存储上传的文件(本地存储)任何人都可以帮助我

<input name="file" type="file" />
    <input type="button" value="Store" />
</form>

1 个解决方案

#1


NOTE

You cant upload and store files using localstorage.

您无法使用localstorage上传和存储文件。

If you want to use local storage,you dnt need a jquery. HTML5 provides you with that feature.

如果你想使用本地存储,你需要一个jquery。 HTML5为您提供该功能。

localStorage.setItem('userid','2'); //To set a data

var userId = localStorage.getItem('userid'); // To get a data

localStorage.removeItem('userid'); //To remove a data

Refer this link for more details Local Storage

有关详细信息,请参阅此链接

#1


NOTE

You cant upload and store files using localstorage.

您无法使用localstorage上传和存储文件。

If you want to use local storage,you dnt need a jquery. HTML5 provides you with that feature.

如果你想使用本地存储,你需要一个jquery。 HTML5为您提供该功能。

localStorage.setItem('userid','2'); //To set a data

var userId = localStorage.getItem('userid'); // To get a data

localStorage.removeItem('userid'); //To remove a data

Refer this link for more details Local Storage

有关详细信息,请参阅此链接