Hi Eric, are setting the request form like this?
<form method="POST" action="/files" enctype="multipart/form-data" accept-charset="UTF-8">
To upload files the enctype="multipart/form-data" attribute must be set :).
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi!
I am having problems with uploading a file (4,3 MB). I have edited Forge config to 50MB. Here is the code:
if ($request->hasFile('file'))
{
$file = $request->file('file');
$filetype = $file->guessExtension();
$filename = 'upload-' . uniqid() . '.' . $filetype;
// Store the file
$file->move(storage_path() . '/app/', $filename);
// Store file information in database.
File::create([
'type' => 6,
'filetype' => $filetype,
'filename' => $filename,
]);
session()->flash('message', 'File saved');
return redirect()->action('FileUploadController@index');
} else {
session()->flash('message_error', 'No file selected!');
return back()->withInput();
}
I am getting the error "No file selected!". I have no problem uploading smaller files.
I am hoping someone can help me here :)
Please or to participate in this conversation.