4 months ago

Uploading a file error

Posted 4 months ago by PaulCatalin97

So, I try to upload a file and shows me this error ! {"_token":"xBDlGKupDvKE3FPI84Eku5Kd6I6l5pKlRHs9LzCk","image":{}} what can i do to solve this ?

class UploadCvController extends Controller
    public function __construct()
    public function index()
        $profilecv = ProfileEmployee::where('uid', Auth::user()->id)->first();
        return view('uploadcv', compact('profilecv'));

    public function update(Request $request)
            'cv' => 'file', 'max:2048',
        $employeecv = ProfileEmployee::where('uid', Auth::user()->id)->first();

        if ($request->hasfile('cv')){
            $file = $request->file('cv');
            $extension = $file->getClientOriginalName();
            $filename = md5(time()).'.'.$extension;
        } else {
            return $request;

            return redirect()->route('uploadcv')->withSuccess('S-a incarcat cu success!');
            return redirect()->back()->withDanger('Nu s-a incarcat! A aparut o eroare.');


How can I convert the file or what can i do ? I dd($request) and says that i receive an image, but I upload a word.docx

Please sign in or create an account to participate in this conversation.