Mahi
Mahi

Reputation: 11

How to store files in local storage using jquery

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

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

Upvotes: 1

Views: 2080

Answers (1)

Abhinav
Abhinav

Reputation: 8168

NOTE

You cant upload and store files using localstorage.

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

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

Upvotes: 1

Related Questions