我使用Maatwebsite / Excel导入CSV文件 . 我的代码看起来像这个教程:http://itsolutionstuff.com/post/laravel-5-import-export-to-excel-and-csv-using-maatwebsite-exampleexample.html我marged这两个函数和我的脚本获取文件并返回文件/
但尽管经过多次尝试,我仍然无法跳过上传文件 . 这意味着,我在特殊文件夹中有CSV文件,我想让这个文件处理数据,而不上传 . 它会自动获取文件(可能是file_get_contents?),并将其传递给Illuminate \ Support \ Facades \ Input .
3 回答
我找到了解决方案我们可以跳过设置为CSV文件路径的
if (Input::hasFile('import_file')) {
和$path
变量You can read your excel file using this code
This is the perfect way to import your csv in laravel 5.*