Maybe the answer Jimhill gave in this thread answers your questions, it's pretty much the same: http://laravel.io/forum/02-17-2014-how-do-you-save-image-to-database-and-display-it-on-website
He writes:
$img_data = file_get_contents($img_path);
$type = pathinfo($img_path, PATHINFO_EXTENSION);
$base64 = $base64_encode($img_data);
// save $base64 & $type into your datastore
Hello,
I am try to add base64_encode to Input::file('file') but convert for image name not the image code here
$file =base64_encode(Input::file('file'));
any help
Hello, I am sloved the problem and i am used this approach to save image in database code here
$file =Input::file('file');
$imagedata = file_get_contents($file);
$base64 = base64_encode($imagedata);
$oUser->avatar = $base64;
$oUser->update();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community