Jump to content

Recommended Posts

Posted

Hi i'm having a recurrent problem I found on this forum: when using the image uploader I get the following error on console "Unexpected token < in JSON". But I couldn't solve it with any of the other proposed solutions:

  • setting debug to true
  • setting $config->uploadTmpDir = dirname(__FILE__) . '/assets/uploads/';
  • setting uploadTmpDir in php.ini

 

BUT This problem only appears for non superuser users (ie editors).

Running on a Digitial Ocean Server with NGINX and PHP 7.1. Version is ProcessWire 3.0.62

Note: Im using Fredi plugin, but i doubt that's the problem because I'm using it in other sites with no problem

 

Any idea how i could solve this (even with non ajax image upload) I need to sort this as fast and simple as possible :)

Thanks in advance

Posted

It looks like there is a PHP error message breaking the JSON - you need to go into your dev console and click on the image upload ajax call and go to the response tab.

  • Like 2
Posted

Thanks @adrian

You made me realize I had code executing on ready.php which was embedding css in the admin page, hence the unexpected <

Others postings led me to think it was a system problem, rather than my own code. 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...