我有这种方法上传CSV格式的文件,但现在我想知道如何将其上传到我的数据库中的列.
我的方法:
public function postUpload ()
{
if (Input::hasFile('file')){
$file = Input::file('file');
$name = time() . '-' . $file->getClientOriginalName();
// Moves file to folder on server
$file->move(public_path() . '/uploads/CSV', $name);
return 'Ok'; // return for testing
}
}
Run Code Online (Sandbox Code Playgroud)
所以我的问题是在这个方法中我怎么能把它放到数据库中?