src/Services/BaseService.php
protected function getUrlAttachment($path = null)
    {
        $attachment = [];
        $file = $path;
        if ($this->request instanceof ServiceRequestInterface) {
            $file = $this->request->input('import_url', $this->request->input('attachment', $path));
        }

        if (!empty($file)) {
            if (!is_array($file)) {
                $files = explode(',', $file);
            } else {
                $files = $file;
            }
            try {
                foreach ($files as $f) {
                    if (is_string($f)) {
                        Session::replaceLookups($f);
                        $fileURL = urldecode($f);
                        $filePath = FileUtilities::importUrlFileToTemp($fileURL);
                        $attachment[] = new Attachment($filePath, basename($fileURL));
                    }
                }
            } catch (\Exception $e) {
                throw new InternalServerErrorException('Failed to import attachment file from url. ' .
                    $e->getMessage());
            }
        }

        return $attachment;
    }
protected function getUrlAttachment($path = null)
    {
        $attachment = [];
        $file = $path;
        if ($this->request instanceof ServiceRequestInterface) {
            $file = $this->request->input('import_url', $this->request->input('attachment', $path));
        }

        if (!empty($file)) {
            if (!is_array($file)) {
                $files = explode(',', $file);
            } else {
                $files = $file;
            }
            try {
                foreach ($files as $f) {
                    if (is_string($f)) {
                        Session::replaceLookups($f);
                        $fileURL = urldecode($f);
                        $filePath = FileUtilities::importUrlFileToTemp($fileURL);
                        $attachment[] = new Attachment($filePath, basename($fileURL));
                    }
                }
            } catch (\Exception $e) {
                throw new InternalServerErrorException('Failed to import attachment file from url. ' .
                    $e->getMessage());
            }
        }

        return $attachment;
    }
Gets URL imported file(s) for attachment.

@param null|string $path

@return array
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException