{"id":127,"date":"2011-07-22T06:18:56","date_gmt":"2011-07-22T06:18:56","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=127"},"modified":"2011-08-11T05:59:16","modified_gmt":"2011-08-11T05:59:16","slug":"wordpress-sorry-this-file-type-is-not-permitted-for-security-reasons","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/wordpress-sorry-this-file-type-is-not-permitted-for-security-reasons\/","title":{"rendered":"WordPress: Sorry, this file type is not permitted for security reasons."},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"25\" data-permalink=\"https:\/\/pixert.com\/blog\/how-to-upgrade-wordpress\/wordpresslogo\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" data-orig-size=\"498,113\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"WordPress &#8211; the logo\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=300%2C68&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=300%2C68\" alt=\"\" title=\"WordPress - the logo\" width=\"300\" height=\"68\" class=\"aligncenter size-medium wp-image-25\" srcset=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?resize=300%2C68&amp;ssl=1 300w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?w=498&amp;ssl=1 498w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Add the following code snippet to functions.php. Change &#8216;filetype&#8217; to the file type that is not permitted for security reasons<\/p>\n<pre class=\"brush: php; title: Code Block; notranslate\" title=\"Code Block\">\r\nadd_filter('upload_mimes', 'custom_upload_mimes');\r\n\r\nfunction custom_upload_mimes ( $existing_mimes=array() ) {\r\n\r\n\t\/\/ add the file extension to the array\r\n\r\n\t$existing_mimes&#x5B;'filetype'] = 'mime\/type';\r\n\r\n        \/\/ call the modified list of extensions\r\n\r\n\treturn $existing_mimes;\r\n\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Add the following code snippet to functions.php. Change &#8216;filetype&#8217; to the file type that is not permitted for security reasons add_filter(&#8216;upload_mimes&#8217;, &#8216;custom_upload_mimes&#8217;); function custom_upload_mimes ( $existing_mimes=array() ) { \/\/ add the file extension to the array $existing_mimes&#x5B;&#8217;filetype&#8217;] = &#8216;mime\/type&#8217;; \/\/ call the modified list of extensions return $existing_mimes; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[54,5],"tags":[55,6,7],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-code-snippet","category-wordpress","tag-code-snippet-2","tag-wordpress-2","tag-wp"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-23","jetpack-related-posts":[{"id":361,"url":"https:\/\/pixert.com\/blog\/allow-wordpress-upload-flash-swf-files\/","url_meta":{"origin":127,"position":0},"title":"How to allow WordPress to upload Flash SWF files","author":"Pixel Insert \/ Pixert","date":"April 29, 2014","format":false,"excerpt":"Some banner ads still use Flash SWF\u00a0format, unfortunately Flash SWF\u00a0is one of few format that has not been permitted in WordPress for security reason. WordPress generate error like this\u201cSorry, this file type is not permitted for security reasons.\u201c when we try to upload Flash SWF\u00a0files in WordPress Previously, we wrote\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"filetypeerror","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2014\/04\/filetypeerror.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2014\/04\/filetypeerror.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2014\/04\/filetypeerror.jpg?resize=525%2C300 1.5x"},"classes":[]},{"id":208,"url":"https:\/\/pixert.com\/blog\/how-to-add-a-wordpress-shortcode-outside-post-editor-php-template\/","url_meta":{"origin":127,"position":1},"title":"How to add a WordPress shortcode outside of the post editor or  PHP templates","author":"Pixel Insert \/ Pixert","date":"March 13, 2012","format":false,"excerpt":"Shortcodes were introduced back in WordPress 2.5. Shortcodes are for creating macros to be use in a posts. For instance, the following shortcode (in the post\/page content) would add a photo gallery into the page: [ \u00a0gallery \u00a0] If you want to use that shortcode outside of the WordPress post\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":134,"url":"https:\/\/pixert.com\/blog\/install-favicon-into-a-wordpress-website\/","url_meta":{"origin":127,"position":2},"title":"Install Favicon into a WordPress website","author":"Pixel Insert \/ Pixert","date":"August 22, 2011","format":false,"excerpt":"1. Upload favicon.ico to the theme directory, e.g wp-content\/themes\/twentyeleven 2. Open file header.php, add the following code between <head> and <\/head> [php]<link rel=\"shortcut icon\" href=\"<?php bloginfo('stylesheet_directory'); ?>\/favicon.ico\" \/>[\/php]","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":277,"url":"https:\/\/pixert.com\/blog\/change-default-wordpress-logo-link-wordpressorg-to-your-domain-name\/","url_meta":{"origin":127,"position":3},"title":"Change Default WordPress Logo Link from wordpress.org to Your Domain Name","author":"Pixel Insert \/ Pixert","date":"January 1, 2013","format":false,"excerpt":"When you open WordPress login page, the default logo links to\u00a0WordPress.org. This is a quick tip for using your own link. Open the\u00a0functions.php\u00a0file. Then, add the following lines of code. And be sure to remember the PHP tag enclosure. [php]function wp_url_loginlogo(){ return \"http:\/\/yourdomain.com\/\"; \/\/ your URL here } add_filter('login_headerurl', 'wpc_url_loginlogo');[\/php]","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"WordPress - the logo","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":179,"url":"https:\/\/pixert.com\/blog\/how-to-change-the-bullet-size-and-color-css\/","url_meta":{"origin":127,"position":4},"title":"How to change the bullet size and color with CSS","author":"Pixel Insert \/ Pixert","date":"December 20, 2011","format":false,"excerpt":"The following code snippet help you change the bullet size and color of your unordered lists. We are using simple CSS code to do that 1. Create your bullet list image via Adobe Photoshop or you can use another image editor to do that (e.g Pixelmator). Save the image as\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/12\/csslogo.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":231,"url":"https:\/\/pixert.com\/blog\/wordpress-shortcode-in-custom-fields\/","url_meta":{"origin":127,"position":5},"title":"WordPress: Shortcode in Custom Field","author":"Pixel Insert \/ Pixert","date":"June 5, 2012","format":false,"excerpt":"Normally wordpress does not run shortcode that you put into a custom field. By default, Custom Fields display whatever value you enter, as plain-text, so if you try entering a shortcode, (in the format [shortcode] VALUE [\/shortcode]) you\u2019ll end up displaying the entire text, including the tags. Add the following\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}