upload - Laravel 4 get image from url -


ok when want upload image. like:

$file = input::file('image'); $destinationpath = 'whereever'; $filename = $file->getclientoriginalname(); $uploadsuccess = input::file('image')->move($destinationpath, $filename);  if( $uploadsuccess ) {     // save url } 

this works fine when user uploads image. how save image url???

if try 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 following error:

call member function move() on non-object 

so, how upload image url laravel 4??

amy appreciated.

i don't know if lot might want @ intervention library. it's intended used image manipulation library provides saving image url:

$image = image::make('http://someurl.com/image.jpg')->save('/path/saveasimagename.jpg'); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -