laravel flutter save image in data

Solutions on MaxInterview for laravel flutter save image in data by the best coders in the world

showing results for - "laravel flutter save image in data"
Abril
31 Jan 2018
1public function uploadFile(Request $request) {
2        if($request->hasFile('image')) {
3            $name = time()."_".$request->file('image')->getClientOriginalName();
4            $request->file('image')->move(public_path('images'), $name);
5        }
6        return response()->json([
7            asset("images/$name"),
8            201,
9            'message' => asset("images/$name") ? 'Image saved' : 'Image failed to save'
10        ]);
11    }
12