The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Cannot upload img o...
 
Share:
Notifications
Clear all

Cannot upload img on desktop

12 Posts
2 Users
0 Reactions
178 Views
Posts: 124
Topic starter
(@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?

11 Replies
Posts: 124
Topic starter
(@danniee)
Estimable Member
Joined: 5 years ago

I can actually upload img on my staging site I just created.

Reply
Posts: 124
Topic starter
(@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?

Reply
6 Replies
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7906

@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.

Reply
(@danniee)
Joined: 5 years ago

Estimable Member
Posts: 124

@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?

Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7906

@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.

Reply
(@danniee)
Joined: 5 years ago

Estimable Member
Posts: 124

@asti I'm curious how this could of happened? I mean, members can't upload images. Is this really normal?

Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7906

@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?

Reply
(@danniee)
Joined: 5 years ago

Estimable Member
Posts: 124

@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.

Reply
Posts: 124
Topic starter
(@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?

Reply
2 Replies
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7906

@danniee 

I don't think you'll face this kind of issue anymore, so I don't recommend you change anything.

Reply
(@danniee)
Joined: 5 years ago

Estimable Member
Posts: 124

@asti hm, how do you know this? I don't even know how this issue happened in the first place :/

Reply
Share: