Skip Navigation

[Resolved] file upload not working

This thread is resolved. Here is a description of the problem and solution.

Problem:

Using CRED form to upload files, get the error message: there was an error occur uploading your file, with some Javascript errors, for example:

OPTIONS https://teach210.wpengine.com/wp-admin/admin-ajax.php?action=cred_frontend_ajax_upload_submit&id=-1&formid=124&nonce=a3a7ee2775 401 ()
 
Failed to load https://teach210.wpengine.com/wp-admin/admin-ajax.php?action=cred_frontend_ajax_upload_submit&id=-1&formid=124&nonce=a3a7ee2775: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://teach210.wpengine.com' is therefore not allowed access. The response had HTTP status code 401.

Solution:

You will need to open the URL with SSL protocol, for example, open:
https://site-URL/.../
and test again

Relevant Documentation:

This support ticket is created 6 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 12 months ago.

Assisted by: Luo Yang.

Author
Posts
#601818
Screenshot 2017-12-27 11.00.51.png

I am trying to: Just upload a basic pdf

Link to a page where the issue can be seen: hidden link

The site is still in staging. You can view with username: demo / password: teach210

I expected to see: file uploaded

Instead, I got: error uploading file

#601918

Dear Stefanie,

Thanks for the details, I can see the problem in your website,
hidden link
when the error occurs: there was an error occur uploading your file
I can see some Javascript errors, for example:

OPTIONS <em><u>hidden link</u></em> 401 ()

Failed to load <em><u>hidden link</u></em>: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<em><u>hidden link</u></em>' is therefore not allowed access. The response had HTTP status code 401.

You will need to open the URL with SSL protocol, for example, open:
hidden link
and test again

#602013

Thank you so much. That fixes it.

#602100

You are welcome