RSS Feed/News Returning a File to the User and Implementing AJAX Form Action

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
23,638
Points
823

Reputation:

Hey

I was wondering and struggling all day on how to make XenForo return a file to the user after a request.
I managed to get it working on direct url access. /xxxx/download
PHP:

Code:
public function actionDownload(ParameterBag $params)
    {
        $visitor = \XF::visitor();

// Check if the user is logged in
        if (!$visitor->user_id) {
            return $this->error('You must be logged in to download scripts.');
        }

$client = \XF::app()->http()->client()...

Read more

Continue reading...
 
Status
Not open for further replies.
Top