0

I'm trying to load an image which is theorically on my local C but this folder links to a server.

I've already tried to type file:/// or file:///// before the path, but nothing seems to work. I'm leaving you the website so you can see by yourself the error in the console and maybe explain to me why it does get stuck!

Website:

http://www.lnf.infn.it/user.html > Scientif Committee > Righ click on that gray background you see at first.

Follow these steps and you should get the errors

FET
  • 942
  • 4
  • 13
  • 35
  • This really won't work. You're telling the client browser to look for a file in the client's computer. It's also a protocol mismatch, between HTTPS and FILE, which violates Same-Origin Request Policy. You need to move the file to the server that's hosting the rest of the website. If you can't, put this file in another server, accessible via HTTP, and link from there. –  Jan 22 '16 at 10:02

2 Answers2

0

Why don't you put the image on server? Then it's easier, you just have to write the relative url without the "file://"

panagulis72
  • 2,129
  • 6
  • 31
  • 71
  • I totally agree with you. nfortunately this is not my website, it's of a company and they gave me this access – FET Jan 22 '16 at 09:56
  • I can see with right click that you write: url("file://///afs/lnf.infn.it/project/www/lnf/committee/nuovo_sito/images/acc.jpg"); ..try to remove some " // " and add C:/, for example: url("file://C:\Users\bg.jpg"); – panagulis72 Jan 22 '16 at 10:02
0

"file://" method will work only if you are browsing webpage on the same computer where your website is hosted and running. You should either try a absolute URL (ex: http://..../file.ext ) or relative url (ex: "/images/myimage.png" ) to display an image.

ShibS
  • 40
  • 7