24 lines
548 B
PHP
24 lines
548 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\RedirectResponse;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Response;
|
|
|
|
class FileUploadController extends Controller {
|
|
|
|
|
|
public function fileUploadPost(Request $request)
|
|
{
|
|
$request->validate([
|
|
'file' => 'required|mimes:pdf|max:2048',
|
|
]);
|
|
|
|
$fileName = time().'.'.$request->file->extension();
|
|
$request->file->move(public_path('uploads'), $fileName);
|
|
|
|
return redirect()->route("process", ['fileName' => $fileName]);
|
|
}
|
|
}
|