laravel-ovh icon indicating copy to clipboard operation
laravel-ovh copied to clipboard

Tem URL HTML file in Iframe is downloading the file instead of displaying it

Open seifti opened this issue 2 years ago • 1 comments

The library works great!

However, after generating a temp link to an HTML file in S3 and adding it as the source of an iframe, this one downloads instead of being displayed in the iframe: <iframe style="width:100%;max-width:860px;display:block;margin:auto;padding:50px; border:none;" scrolling="no" src="https://storage.GRA.cloud.ovh.net/v1/AUTH_09b2a1dadcfb457dbcf5b28deebae0bc/seifti_s3/cms/35/es/testdoc35/html?temp_url_sig=50532a640d1dceb3290a63a9a0cabd6c57462d0e&temp_url_expires=1657349539"></iframe>

is there anyway to change the headers so it doesn't download?

The URL:

 $url = Storage::disk('ovh')->temporaryUrl($path, now()->addMinutes(1),   [
            'CONTENT_DISPOSITION' => 'inline',
            'CONTENT_TYPE' => 'text/html'
        ]);

seifti avatar Jul 08 '22 16:07 seifti

@seifti We're not using the additional headers in this method. I can't see that there is any support for it in the openstack documentation either.

However, if you think it's possible to implement this I'd be happy to receive a PR :smiley:

sausin avatar Jul 20 '22 13:07 sausin