Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1610

Joomla! 4.x Coding • Download file header issue

$
0
0
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:

Code:

header('Content-Disposition: attachment');
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)?

Statistics: Posted by kennm — Fri Mar 01, 2024 2:33 pm



Viewing all articles
Browse latest Browse all 1610

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>