lundi 26 février 2018

Https urls in Laravel - Rackspace with Filesystem

I am using filesystem package without problems for upload and download files to rackspace. According to docs on how to obtain the file url I do:

$content = fopen('logo.png', 'r+');
\Storage::disk('disk_temp')->put('logos/logo.png', $content);

$url = \Storage::disk('disk_temp')->url('logos/logos.png');

Works good. But, this url is http:// version. How to obtain the secure version like https:// if I am using rackspace vendor? Here my config:

'disk_temp' => [
        'driver'    => 'rackspace',
        'username'  => env('RS_USER'),
        'key'       => env('RS_API'),
        'container' => 'disk_temp',
        'endpoint'  => 'https://identity.api.rackspacecloud.com/v2.0/',
        'region'    => env('RS_REGION', 'DFW'),
        'url_type'  => 'publicURL',
    ],

Years before, I used Open Cloud successfully, obtaining the URL as

$file = \OpenCloud::container('cdn')->uploadObject($filename, $content);
$url = (string) $file->getPublicUrl(UrlType::SSL);

Just to know if possible doing the same from laravel itself. Thank you in advance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2osrzFd
via IFTTT

Aucun commentaire:

Enregistrer un commentaire