public function uploadCSV() { //return public_path(); $dataAccount = DataAccount::create(array('dataaccount' => Input::get('newdataaccount'), 'user_id' => Input::get('user_id'))); $dataaccount = $dataAccount->id; //return Input::get('newdataaccount'); if (Input::hasFile('file')) { $file = Input::file('file'); $name = time() . '-' . $file->getClientOriginalName(); //check out the edit content on bottom of my answer for details on $storage //$storage = public_path().'/../app/storage'; $storage = public_path(); $path = $storage . '/uploads/CSV/'; // Moves file to folder on server $file->move($path, $name); // Import the moved file to DB and return OK if there were rows affected $this->_import_csv($path, $name, $dataaccount); //? 'OK' : 'No rows affected' ); // After upload create word cloud return Response::json(Word::createWordCloud($dataaccount)); return 'OK'; //? 'OK' : 'No rows affected' ); } //return Response::json( Input::file('file')->getClientOriginalName() ); }