simao's avatar
Level 1

vue js file upload form

I try to create a VueJs upload excel files form component. the file is posted via axios as base64. to store the file i use this : $request->get('file')->save(public_path('excel/').$fileName);

When i post the form i get this error : Call to a member function save() on string

0 likes
1 reply
MikeHarvey's avatar
Level 6

Try something like

$file = base64_decode($request->get('file')); $file->save(public_path('excel/').$fileName);

You just need to decode it back to an image format

Please or to participate in this conversation.