Safari downloading blob url in an iframe

I am trying to render user generated/uploaded files such as images and pdf files in the browser. To do this I am making a request to my backend server for the file, saving it as a blob, generating a blob url, then using that url in an iframe tag.

This works fine in chrome and firefox (yet to test IE). In safari when the iframe loads it downloads the file with then filename “Unknown” and does not render it.