I created a component wich purpose is to download the file by a user. It's a bit complex to explain it briefly, but to put things simple, I want the file to be downloaded with use of PHP code (therea are many ifs - what and whether is downloaded, depanding on the context - which don't matter to the issue). This is the single header in the PHP code that causes the user being forced to sign-in to the website:
However I don't want Joomla to force the user to sign in. When I remove this header, Joomla "magically" stops requiring the user to sign-in - which is what I want, i.e. the user should NOT be redirected to the login page. But then, instead the file is openning in the browser - which is not want I want. How can I make user download the file, not open in the browser, and not require to sign in (as then Joomla, as mentioned, redirects the user to the login page)?
Code:
header('Content-Disposition: attachment');
Statistics: Posted by kennm — Fri Mar 01, 2024 2:33 pm