Вот как я загружаю файл через мое представление, полученное из HomeController @ index:
<form action='csvUpload' method='POST'>
@csrf
<input type='file' name='dataframe' enctype="multipart/form-data">
<button type='submit' name='upload'>Predict</button>
</form>
Вот мои веб-маршруты:
Auth::routes(['verify' => true]);
Route::get('/home', 'HomeController@index')->name('home');
Route::post('/csvUpload', 'HomeController@predict')->name('home');
Вот мой HomeController @ предикат:
public function predict(Request $request)
{
$file = $request->dataframe;
var_dump($file); # I want this to be the actual file or
# To store it locally and then get that file path
}
Что возвращает string(13) "languages.csv"
, когда я загружаю свой CSV-файл. Как я могу получить актуальный файл? Я пытался $request->file('dataframe')
, но это возвращает ноль.