Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73964

Call to a member function getClientOriginalExtension() on string errors coming when trying to get file extension?

$
0
0

when uploading a file from html page and need to get the file extension. But the uses function showing an error. What are procedure to solve that issue?

public function downloadAttendance(Request $request)
    {
        $this->validate($request, [
            'attendance_date' => 'required',
            'attendance_file' => 'required',
        ]);

        $date = $request->attendance_date ? database_formatted_date($request->attendance_date) : null;
        $file = $request->attendance_file;
        $file_ext = $file->getClientOriginalExtension();
        dd($file_ext);
        $file_path = $file->getRealPath();
    }

Viewing all articles
Browse latest Browse all 73964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>