{"id":2156,"date":"2019-08-22T13:26:59","date_gmt":"2019-08-22T12:26:59","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=2156"},"modified":"2025-12-02T22:03:54","modified_gmt":"2025-12-02T22:03:54","slug":"uploads-directory","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/wordpress\/files-wordpress\/uploads-directory","title":{"rendered":"Uploads Directory"},"content":{"rendered":"\n<h5 class=\"wp-block-heading\">Create our own directory within \/uploads<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>      $UploadDirectory = wp_upload_dir(); \n      $OurUploadDirectory = $UploadDirectory&#91;'basedir'] . '\/' . 'our_folder_name';\n      if (!file_exists($OurUploadDirectory))\n        wp_mkdir_p($OurUploadDirectory);<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Create our own directory on site root<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>      $OurUploadDirectory = $_SERVER&#91;'DOCUMENT_ROOT'] . '\/mynewfolder';\n      if (!file_exists($OurUploadDirectory))\n      {\n        wp_mkdir_p($OurUploadDirectory);\n        chmod($OurUploadDirectory, 02775);     \/\/Set folder permissions to allow read of files added to folder\n      }<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Create our own directory within \/uploads Create our own directory on site root<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[178],"tags":[],"class_list":["post-2156","post","type-post","status-publish","format-standard","hentry","category-files-wordpress"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=2156"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2156\/revisions"}],"predecessor-version":[{"id":5211,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2156\/revisions\/5211"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=2156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=2156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}