Get external images without having to upload them
PermalinkAn interface like google slides - add image or the WIX interface would be great.
use Concrete\Core\Support\Facade\Application; function getImgViaURL($this_url) { $app = Application::getFacadeApplication(); $cf = $app->make('helper/file'); $file = $app->make('helper/file'); $fp = FilePermissions::getGlobal(); $valt = $app->make('helper/validation/token'); $app->make('helper/mime'); $error = $app->make('helper/validation/error'); // $this_url = trim($_REQUEST['url_upload_' .$i]); $client = $app->make('http/client'); $request = $client->getRequest(); $request->setUri($this_url); $response = $client->send(); if ($response->isSuccess()) {
Hope it helps someone. Took me a while.
Oh and if you get a uri string error from zend, just make sure there aren't any funky characters in you uri string. I had to str_replace a bunch of soft hyphens.
You can import from a URL but you have to add each file on single lines which is a pain.