{"id":102,"date":"2026-08-20T04:34:04","date_gmt":"2026-08-20T04:34:04","guid":{"rendered":"https:\/\/kraeftigerkaese.xyz\/tech\/?p=102"},"modified":"2026-08-20T04:34:05","modified_gmt":"2026-08-20T04:34:05","slug":"allowing-doc-and-docx-files-to-be-uploaded-to-php-server","status":"publish","type":"post","link":"https:\/\/kraeftigerkaese.xyz\/tech\/allowing-doc-and-docx-files-to-be-uploaded-to-php-server\/","title":{"rendered":"Allowing doc and docx files to be uploaded to PHP server"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Trying to write some simple application using PHP 8.4.x w\/Apache 2.4.x w\/mariadb recently.  Ran into a snag on allowing Ms-Docx files to be uploaded to a local temp dir then into a physical location.  After some configuration with httpd.conf file to allow both doc and docx extension inside httpd.conf file. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"82\" src=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-4-1024x82.png\" alt=\"\" class=\"wp-image-103\" srcset=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-4-1024x82.png 1024w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-4-300x24.png 300w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-4-763x61.png 763w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-4-288x23.png 288w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-4-838x67.png 838w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-4.png 1063w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next, the mime_mod module should be enabled along with uncomment out the mod_type file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"71\" src=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-5.png\" alt=\"\" class=\"wp-image-104\" srcset=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-5.png 710w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-5-300x30-1.png 300w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">make sure docx extension is uncomment out in this mime.types file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"60\" src=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-6-1024x60.png\" alt=\"\" class=\"wp-image-105\" srcset=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-6-1024x60.png 1024w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-6-300x18.png 300w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-6-753x44.png 753w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-6-291x17.png 291w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-6-838x49.png 838w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-6.png 1078w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, check your php.ini inside your php installation to allow the following items. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"372\" src=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-7.png\" alt=\"\" class=\"wp-image-106\" srcset=\"https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-7.png 845w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-7-300x132-1.png 300w, https:\/\/kraeftigerkaese.xyz\/tech\/wp-content\/uploads\/2026\/08\/image-7-768x338.png 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That should enabled the upload of doc and docx files onto a temp location in your OS from aspect of the programming software. The php code would now need to check for its mime type for both doc and docx extension.  Your temp location will be different from my custom location within PHP. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trying to write some simple application using PHP 8.4.x w\/Apache 2.4.x w\/mariadb recently. Ran into a snag on allowing Ms-Docx files to be uploaded to a local temp dir then into a physical location. After some configuration with httpd.conf file to allow both doc and docx extension inside httpd.conf file. Next, the mime_mod module should&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,7],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-blog","category-php"],"_links":{"self":[{"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":1,"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/posts\/102\/revisions\/107"}],"wp:attachment":[{"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kraeftigerkaese.xyz\/tech\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}