php - Laravel 3 create Text (CSV) file -


hello trying grab emails database, output them text (comma separated) file. here have done not work:

public function get_textfile() {  $emails = staff::get('email');  header("content-type: text/csv");   header("cache-control: no-store, no-cache");   header('content-disposition: attachment; filename="filename.txt"');  $stream = fopen("php://output", 'w');  foreach($emails $email) { fputcsv($stream, $email, ','); }  fclose($outstream);      }  return (something)? 

getting this: error 6 (net::err_file_not_found): file or directory not found.

this route:

    route::get('textfile', array('as' => 'textfile','uses' => 'admin@textfile')); 

try file_put_contents($filename, implode(',', staff::get('email')));


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -