0

This might be a basic question but I have a link to a file

<a href = "http://sitename.com/path/to/file.jpg">File Name</a>

I want to leave it a link, but when I click it the image just downloads. I would like for it to open in the browser instead of downloading. How can I do this? I feel like this should be easy, but for some reason I can't find the solution.

Benjamin Thvedt
  • 351
  • 1
  • 3
  • 17

1 Answers1

2

Your webserver isn't sending the right headers.

If you curl -I http://sitename.com/path/to/file.jpg you should see a header Content-Type.

The correct answer is: Content-Type: image/jpeg

More specific answers are going to depend upon what webserver you're using.