0

EDIT:

I need to get an image out of "resources" package, the image is in the folder `C:/folder, this code works in Explorer browser, but don't works un google chrome browser.

want my project to work on both of us.

<p:row>
  <p:column>
    <h:graphicImage
      url="file:///C:/test/2018/03/13/test.jpg"
      style="width: 100%;margin-top: 10%;" />
  </p:column>
</p:row>

I'm trying use the above code, but it doesn't work.

EDIT 2:

I tryed:

  • execute Google Chrome as Administrator;
  • execute chrome with permission to access files and folder using

    --allow-file-access-from-files

Leandro Kojima
  • 127
  • 1
  • 12
  • Possible duplicate of [How can I display an image from the local machine on a webpage](https://stackoverflow.com/questions/28194444/how-can-i-display-an-image-from-the-local-machine-on-a-webpage) – esqew Mar 13 '19 at 18:01

1 Answers1

0

You need to use a file: url to referance files on your local machine like this:

<p:row>
  <p:column>
    <h:graphicImage
      url="file:///C:/test/2018/03/13/test.jpg"
      style="width: 100%;margin-top: 10%;" />
  </p:column>
</p:row>
Rain336
  • 1,450
  • 14
  • 21