0

Hi the problem i have is that i have a carpet that contains pdf files. I need to show this pdf files in a django template and i dont know what im doing wrong.

templates and pdf containers are at the same level

<body>
    <object data="ea_Junio_2017.pdf" type="application/pdf" title="SamplePdf"     width="500" height="720">
        <embed src="ea_Junio_2017.pdf" >
    </object>

<body>

The problem is that the program can't get the file and drops me this error "GET /pdf/ea_Junio_2017.pdf HTTP/1.1" 404 2778"

There is something that im doing wrong?

Eric Cano
  • 21
  • 6
  • Do you have anything configured to serve the file at that URL? What happens if you enter the link directly? – Daniel Roseman Jun 06 '17 at 14:41
  • If i put the pdf in the web browser y get file:///home/nayar/proyecto_django/miaplicacion/pdf/ea_Junio_2017.pdf this url, and i put in the object/embed without the 404 error but display nothing. Is that what u are asking? – Eric Cano Jun 06 '17 at 14:50
  • No, not at all. You need an actual URL to serve the file on; the browser is trying to load http://yourwebsite/pdf/ea_Junio_2017.pdf , and the fact that this is not found has nothing whatsoever to do with embedding. – Daniel Roseman Jun 06 '17 at 14:54
  • Ah okey i think how to do it now, the problem was the URL true – Eric Cano Jun 06 '17 at 14:59

0 Answers0