sausin / laravel-ovh

Wrapper for OVH Object Storage integration with laravel
MIT License
37 stars 12 forks source link

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

Closed seifti closed 2 years ago

seifti commented 2 years ago

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'
        ]);
sausin commented 2 years ago

@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: