This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

akhil.addweb30900
akhil.addweb30900

How can I create new JSON file and then this file download for the fronted user?

Please Help me !!

Last updated

Briddle
Briddle

Hi Akhill,

Add this to the top of your class file:

 use File;
 use Response;

Add this to your class:

  public function download($content)
  {
      return Response::make($content, 200, [
          'Content-Type'        => 'application/json',
          'Content-Disposition' => "filename=myfile.json"
       ]);
  }
  1. Call the function...

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.