mardi 15 novembre 2016

How to upload file from a REST API with laravel5

i am new to laravel and having an issue regarding REST API over file processing,and i am using dingo laravel api Here what i have done so for

    $user =  User::findOrFail($request->user_id);
    $user->first_name = $request->first_name;
    $user->avatar = $request->file('userfile');
    if($user->save()){
        return response()->json($user, 200);
    }

How do i post a file or image from api and then store in upload folders physically ? I am able to post data without file.

Any help will be highly appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire