Replacing downloading of Documents by a web view

Hi all,

I am looking to make the PDF and JPG file show in another tab in the navigator instead of downloading it. In our documents we have a lot that has the same name, and we need something like that to be sure its the good doc we want to download.

I DON’T WANT A PREVIEW. I already did that as a temporary solution, but we really want to have it open in another tab in our navigator.

First, I made a custom entry point and all the things needed, my only problem is that i can’t find how to replace the link on the file name by the link of my entry point.

I tried everything i could, modified the code of ducument.php, doing a logic hook on process to change the filename. Of course I have quick rebuild and delete the cache each time.

If you have any idea or just know that I’m doing something wrong, please tell me.

And one bonus question, does anyone know how i could show the other type of file as well. I heard that i would need to transform them in jpg or something like that, but i don’t know how to do that on a xampp.

Thank you.

You need to set the Content-Disposition to be inline instead of attachment to have it open in the browser instead of download.

I dont really understand what is it and how to do it, could you have a link explaining me how to do that ?

Thank you for your reply.

When you download a document, it hits an entry point which points to the download.php file. In this file you can see the Content-Disposition is set in the header.

Thank you that was exactly waht i was looking for.