If i remove resize code then image uploaded successfully. I have created directory as /public/uploads/business and /public/uploads/business/thumb. Can you please help me to resolve it.
@Vija Have you checked your Laravel logs for what the "unknown error" contains? You can also access it via command line running php artisan tail to see it real time.
As I'm unsure what version of Laravel your using or the Image manipulation package, I'm going to assume it's Laravel 5.x and intervention/image
$file = Input::file('image');
// Define our destinations
$destinationPath = 'uploads/business/';
$destinationPathThumb = $destinationPath . 'thumb/';
// What's the original filename
$filename = $file->getClientOriginalName();
// Upload the original
$original = $file->move($destinationPath, $filename);
// Create a thumb sized from the original and save to the thumb path
$thumb = Image::make($original->getRealPath())
->resize(200, 200)
->save($destinationPathThumb . $filename);
// Respond with json
return Response::json([
'success' => true,
'file' => asset($destinationPath . $filename),
'filename' => $filename
]);