• I ran into an issue where uploading an image larger than ~50kb resulted in wp-comments-post.php returning a 404 error. This had nothing to do with the plugin itself as it worked fine in a local testing environment. Rather, it appears my webhost (HostGator) has some odd security rules tied specifically to wp-comments-post.php. (The maximum upload size is set to 64 MB and had nothing to do with the problem.)

    So if you are getting 404 errors after uploading an image through Comment Attachment, here are a couple solutions:

    1. Try a different web host or a local environment using DesktopServer.

    2. Make a copy of wp-comments-post.php and name it blahblah.php. Then, when calling the comment form in your theme, specify it to use the new file like this:

    comment_form(array('action' => '/blahblah.php'));

    Yes, merely renaming the file fixed the 404 issue for me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi chadrew, thanks for this and I’m hoping it will work…I just can’t quite get there — where exactly do you find where the theme calls for the comment form? I’ve been through every page in the Theme Editor and can’t find it. Is it in one of the other files that I can access in HostGator’s file manager?

    Thanks a ton,
    Mark

    btw I’m just using WordPress’ 2019 theme, so I figure it ought to be in a usual spot. Found one instance of it in ‘comment-template.php’ within wp-includes, but that didn’t do it.

    Nevermind, forgot to edit the plugin itself ?? whoops!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PSA to those getting 404 errors when uploading image’ is closed to new replies.