Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)
Check if the file path is correct and the file exists – in my case that was the issue – as I fixed it, the error disappeared
Check if the file path is correct and the file exists – in my case that was the issue – as I fixed it, the error disappeared
You must ensure that the lines are not accidentally broken (as they are above, though it’s hard to say if that was a copy-paste problem) — with an intact message such as: Received: (qmail 8580 invoked from network); 15 Jun 2010 21:43:22 -0400 Received: from mail-fx0-f44.google.com (209.85.161.44) by ip-73-187-35-131.ip.secureserver.net with SMTP; 15 Jun 2010 21:43:22 … Read more
In a multipart e-mail, email.message.Message.get_payload() returns a list with one item for each part. The easiest way is to walk the message and get the payload on each part: import email msg = email.message_from_string(raw_message) for part in msg.walk(): # each part is a either non-multipart, or another multipart message # that contains further parts… Message … Read more
I realize that this question is old, but for anyone looking for a quick copy/paste for adding font MIME types to their .htaccess: <IfModule mod_mime.c> AddType application/vnd.ms-fontobject .eot AddType application/x-font-opentype .otf AddType image/svg+xml .svg AddType application/x-font-ttf .ttf AddType application/font-woff .woff AddType application/font-woff2 .woff2 </IfModule>
You can use application/octet-stream for unknown types. RFC 2046 states in section 4.5.1: The “octet-stream” subtype is used to indicate that a body contains arbitrary binary data.
Use file. Examples: > file –mime-type image.png image.png: image/png > file -b –mime-type image.png image/png > file -i FILE_NAME image.png: image/png; charset=binary
I’ve had success with exactly the same headers as you’re using, with the following differences: Embedded is not a valid value for the Content-Disposition header. attachment should be fine. inline should also be fine, though I’ve usually seen attachment for multipart/related embedded images. The value of the Content-ID header is supposed to be in the … Read more
This answer extends yurin’s answer. The issue he brought up was that the content of a MimeMultipart may itself be another MimeMultipart. The getTextFromMimeMultipart() method below recurses in such cases on the content until the message body has been fully parsed. private String getTextFromMessage(Message message) throws MessagingException, IOException { String result = “”; if (message.isMimeType(“text/plain”)) … Read more
Update For a more practical and up-to-date answer, have a look at Palec’s answer. The specified character encoding in Content-Type does only describe the character encoding of the message body but not the header. You need to use the encoded-word syntax with either the quoted-printable encoding or the Base64 encoding: encoded-word = “=?” charset “?” encoding … Read more
You could try to force the browser to open a “Save As…” dialog by doing something like: header(‘Content-type: text/csv’); header(‘Content-disposition: attachment;filename=MyVerySpecial.csv’); echo “cell 1, cell 2”; Which should work across most major browsers.