1

I have a folder with images and folder with vue-app(archy)

enter image description here

so i need to get in components those images I tried something like this, but didn't succeed

<div v-if='photo' class="post-img">
  <img :src="`~@/../../uploads/posts/${photo}`" alt="img">
</div>

any suggestions?

fleple
  • 95
  • 8
  • How is those files being loaded by your application server? I mean, are they accessible like: `http://myserver:8080/somecontextfolder/uploads/posts/.....` ? Depending on it you can just reference the relative path for it. – Jorge Campos Aug 07 '18 at 17:21
  • client-app sends them to the server-app and server-app saves them in external folder, but how to get access to them i don't know – fleple Aug 07 '18 at 17:28
  • Have your server-app return you the url of the resource. You can't use the relative path directly because those are substituted at build time. You need a public url for the media – Julio Aug 07 '18 at 18:56
  • I tried to save in server the whole path, so i get something like this "../uploads/posts/3971de6a-3ef1-4b6f-b95d-5591cd6c42eb.jpeg" but i still have no access to it – fleple Aug 07 '18 at 19:08

0 Answers0