The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Cannot upload img on desktop
How-to and Troubleshooting
(@danniee)
Estimable Member
Joined: 5 years ago
I've just discovered that I cannot upload images to comments when on desktop. However, it works fine on iPhone when I tried. I have tried on several different computers. I have another site that is also using the latest version of wpdiscuz, and upload works fine on desktop there, so clearly something is wrong with my site. I cannot figure out what.
When I check console on Chrome, I see the following error messages when I try to upload an img on desktop:
jquery.min.js:2
POST https:// www. mysite .com/wp-admin/admin-ajax.php 400 (Bad Request)
send @ jquery.min.js:2
ajax @ jquery.min.js:2
(anonymous) @ jquery-migrate.min.js:2
e.<computed> @ jquery-migrate.min.js:2
_e @ wpdiscuz-combo.min.js:10
(anonymous) @ wpdiscuz-combo.min.js:14
(anonymous) @ wpdiscuz-combo.min.js:14
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
c @ rocket-loader.min.js:1
wpdiscuz-combo.min.js:14
Any ideas?
(@danniee)
Estimable Member
Joined: 5 years ago
I can actually upload img on my staging site I just created.
(@danniee)
Estimable Member
Joined: 5 years ago
Hm, it appears it was a local browser cache issue because it works fine after clearing cache. But the problem is other visitors are experiencing the same thing and not everyone will know to clear their cache. Any suggestions?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8191
Mar 13, 2025 10:25 am
@danniee
We're really sorry, but, there is no solution we can provide in this case. The wpDiscuz plugin cannot clear the local browser cache.
However, you can add a small description, such as an admin note, using the comment_main_form_after_head hook.
(@danniee)
Joined: 5 years ago
Estimable Member
Posts: 124
Mar 13, 2025 10:27 am
@asti I understand. I did not know this when I started the thread but eventually came to this conclusion.
What do you suggest I do with that hook?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8191
Mar 13, 2025 10:35 am
@danniee
You can write an admin note asking users to press CTRL+F5 if they experience any issues like this.
add_action("comment_main_form_after_head", function () {
echo "Dear users, if you come across any difficulty with uploading images, please press CTRL+F5 (to clear the browser cache) and try again. If you still have any issues, please contact the website administrator at your email@example.com.";
});
This is just an example—you can customize the red-marked text as needed.
This is not the only hook that allows you to add such a custom message. You can find all available hooks here: https://wpdiscuz.com/docs/codex/actions/
Once you review them, you can choose the one that best fits your needs.
(@danniee)
Joined: 5 years ago
Estimable Member
Posts: 124
Mar 13, 2025 1:55 pm
@asti I'm curious how this could of happened? I mean, members can't upload images. Is this really normal?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8191
Mar 14, 2025 9:58 am
@danniee
This is not normal. The only possible reason for this issue is a cache problem. I'm not sure if your website visitors have ever been unable to attach a file.
I've just answered your question:
But the problem is other visitors are experiencing the same thing and not everyone will know to clear their cache. Any suggestions?
(@danniee)
Joined: 5 years ago
Estimable Member
Posts: 124
Mar 14, 2025 10:09 am
@asti yes, I am aware of all of this but I'm curious how this could have happened with this plugin particularly. It doesn't matter what I do. I can turn off all cache on the site and cloudflare as well, but the problem persists since it's now become a problem with users browser cache.
Oh well. That's life running a website I guess.
(@danniee)
Estimable Member
Joined: 5 years ago
Hm, if you can tell me which js file is used to attach images maybe I can make a small edit to that file and see if it breaks browser cache. Are you able to tell me?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8191
Mar 15, 2025 11:06 am
@danniee
I don't think you'll face this kind of issue anymore, so I don't recommend you change anything.
(@danniee)
Joined: 5 years ago
Estimable Member
Posts: 124
Mar 15, 2025 1:02 pm
@asti hm, how do you know this? I don't even know how this issue happened in the first place :/