OK, so when I want to upload an image. Usually I do something like:
$file = Input::file('image'); $destinationPath = 'whereEver'; $filename = $file->getClientOriginalName(); $uploadSuccess = Input::file('image')->move($destinationPath, $filename); if( $uploadSuccess ) {
This works great when the user uploads an image. But how to save image from URL ???
If I try something like:
$url = 'http://www.whereEver.com/some/image'; $file = file_get_contents($url);
and then:
$filename = $file->getClientOriginalName(); $uploadSuccess = Input::file('image')->move($destinationPath, $filename);
I get the following error:
Call to a member function move() on a non-object
So how to load image from url with laravel 4 ??
Help me help.
source share