PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 29, 2022

[FIXED] how do I display the image that was saved to local storage?

 July 29, 2022     image, javascript, vue.js, vuex     No comments   

Issue

My problem is I saved an image to the local storage but when I retrieve it from vuex and paste it into the code the image does not appear.

The object I get from vuex:

place: {
    ....
    imgPath: C:\Users\...\Pictures\abc\b\first.jpg
    ....
}

and vuetify code:

<v-img v-bind:src="place.imgPath"></v-img>

Solution

Vue is intended to be run on a webserver. Including files directly from your local hard drive is a security problem and thus not allowed. Either include the image in your assets so Vue can include it that way, or host the image on a domain somewhere, so you can hot link it from there. Again, paths starting with a drive letter will not (and should not) work.



Answered By - Sumurai8
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing