T
T
tayoboc2017-02-23 15:02:53
Django
tayoboc, 2017-02-23 15:02:53

Why is the link to localhost not working?

Tell me why the link through the tag to the local file does not work (hosted on the same computer? I use Bottle.<a href>

<b><td><a href="file:{{adres}}">Adres</a></td>              НЕ РАБОТАЕТ
  <td><a href="file://localhost:8080/{{adres}}">Adres</a></td></b>   НЕ РАБОТАЕТ
  <td><a href="/edit/{{id}}">Edit</a></td>                      РАБОТАЕТ

That is, the Edit link opens, but the file does not.
If you copy the link and open it through the address bar, the file opens.
Thank you!
UPD
I try through iframe - it does not work either.
return '''
     <html>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
     <body>
         <iframe name="pdf" src="file:///C:\Python34\M\tmp\55.pdf" style="width: 1000px; height:800px;" align="absmiddle" frameborder="no"></iframe>
         <p>OK</>
     </body>
     </html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Filatov, 2017-12-02
@lynx06

As far as I remember, it is not necessary to write "file:/" If you immediately write the path to the file, it should work. For example: /localhost:8080/{{adres}}. (I can't help with iframe because I didn't even know)
PS If I have Lynux ubuntu 17.6 and everything can be different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question