Get external images without having to upload them
Permalink
Is it possible to add an image directly from the web or through dropbox/google drive etc without having to upload image files from your hardrive.
An interface like google slides - add image or the WIX interface would be great.
An interface like google slides - add image or the WIX interface would be great.
It took a while but I looked in tools/remote.php. here is the modified code.
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.
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()) {
Viewing 15 lines of 59 lines. View entire code block.
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.