{"id":9,"date":"2017-04-19T18:50:01","date_gmt":"2017-04-19T18:50:01","guid":{"rendered":"http:\/\/www.webleaps.com\/blog\/?p=9"},"modified":"2017-05-05T17:24:21","modified_gmt":"2017-05-05T17:24:21","slug":"image-upload-error-no-such-file-or-directory","status":"publish","type":"post","link":"https:\/\/www.webleaps.com\/blog\/code\/image-upload-error-no-such-file-or-directory\/","title":{"rendered":"Image Upload Error No such file or directory"},"content":{"rendered":"<p>Have you ever seen this error while doing a file upload?\u00a0Warning: getimagesize(images_sm\/image.png) [function.getimagesize]: failed to open stream: No such file or directory in \/home\/file.php on line 70<\/p>\n<p>This error is typically associated with a permissions error on the folder(s) that you are trying to upload the image into.\u00a0 Namely that you haven&#8217;t allowed enough access to be able to upload images into these folders.<\/p>\n<p>So if you&#8217;ve tried to adjust permissions and are still hitting your head on the wall, do a quick code check.\u00a0 If you recently moved servers\/had a server upgrade these issues can sometimes be due to deprecated code.\u00a0 In this case the file upload code was using<\/p>\n<p>$HTTP_POST_FILES which is deprecated<\/p>\n<p>Doing a quick update from $HTTP_POST_FILES to $_FILES will fix the error and have you uploading files once again in minutes!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever seen this error while doing a file upload?\u00a0Warning: getimagesize(images_sm\/image.png) [function.getimagesize]: failed to open stream: No such file or directory in \/home\/file.php on line 70 This error is typically associated with a permissions error on the folder(s) that you are trying to upload the image into.\u00a0 Namely that you haven&#8217;t allowed enough access [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":14,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":3,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions\/21"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/media\/14"}],"wp:attachment":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}