$request->input(); $saving_path = storage_path('app/public/' . $_FILES['file']['name']); move_uploaded_file($_FILES['file']['tmp_name'], $saving_path); chmod($saving_path, 0755); $data['file_name'] = $_FILES['file']['name']; $data['file_url'] = url('storage/', $_FILES['file']['name']); session()->put('inquiry', $data); return redirect()->route('confirm'); }