Google Chrome complains about flash when using <embed> with PDF file
I found the answer.
The files I was trying to display with the <embed>
were being uploaded to a bucket in AWS S3. When uploading the files (with a PHP script), the Content-Type
metadata needed to be set accordingly to the file (i.e. application/pdf
for PDF files).
The files were being uploaded with a default Content-Type
value, thus the browser didn't know what to do with it once placed in a <embed>
tag (the Content-type
is used to determine which plugin to choose to display).
I found this method to be very easy to implement as a generic file previewer.