rooofl Posted October 10 Posted October 10 Hello, I am facing an upload issue. I get this JS error when I drop images in image fields: XHR POSThttps://foo.com/admin/page/edit/?id=1102&InputfieldFileAjax=1[HTTP/2 403 41ms] Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data uploadFile https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 uploadFile https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 traverseFiles https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 setupDropzone https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 setupDropzone https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 initHTML5Item https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 initUploadHTML5 https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 jQuery 2 initUploadHTML5 https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 init https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 InputfieldImage https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 <anonymous> https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1 jQuery 8 InputfieldImage.min.js:1:35804 I updated PW recently and also upgraded the PHP version. Maybe that can be related!
matjazp Posted October 10 Posted October 10 Check PW error logs. This is because of the error in php/module resulting in invalid JSON. Do a modules refresh and upgrade them to the latest version.
rooofl Posted October 10 Author Posted October 10 Thank you @matjazp. I refreshed the modules from the log. I think I updated all the module that needed to be updated (I guess). I also installed the Upgrades module to be sure. The logs doesn’t log anything when I try to upload an image. The error remains. My FieldtypeFile module is at v. 1.0.7 and FieldtypeImage at v. 1.0.2.
matjazp Posted October 10 Posted October 10 You have PHP 8.4? Then use the latest (not yet dev): https://github.com/processwire/processwire/archive/dbbb239a74231d5371c77cd23cb6e48aba90b8ef.zip
rooofl Posted October 10 Author Posted October 10 Yes I have PHP 8.4. I tried to install the PW version you advise, but my site and admin went totally blank, even with debug enabled in config.
matjazp Posted October 10 Posted October 10 Do you have access to admin? To the file system? Double check that you uploaded the complete wire directory and new indxex.php file.
rooofl Posted October 11 Author Posted October 11 Yes, I triple checked everything. Also, I wonder why it would not work with the current PW version I use: 3.0.246
matjazp Posted October 11 Posted October 11 11 hours ago, rooofl said: Also, I wonder why it would not work with the current PW version I use: 3.0.246 Because 3.0.246 might not be 100% compatible with PHP 8.4. On 10/10/2025 at 1:51 PM, rooofl said: I tried to install the PW version you advise, but my site and admin went totally blank, even with debug enabled in config. That's odd. I use this version even on PHP 8.5 without (major) issues.
rooofl Posted October 12 Author Posted October 12 12 hours ago, matjazp said: Because 3.0.246 might not be 100% compatible with PHP 8.4. But the issue existed with the older version of PHP I ran, actually I upgrade PHP and PW because of this issue.
matjazp Posted October 12 Posted October 12 3 hours ago, rooofl said: But the issue existed with the older version of PHP I ran, actually I upgrade PHP and PW because of this issue. This is new information. You stated in the first post that your upgraded PHP and PW. Check XHR response headers in browser's dev tools.
monollonom Posted October 12 Posted October 12 There are quite a few topics with this issue but maybe this specific answer from @Robin S could help? Also, since it seems to be an issue with AJAX, are you seeing any difference if you toggle on (or off) this option? 1
rooofl Posted October 13 Author Posted October 13 (edited) @matjazp I understand this was precious information, and I am sorry I missed that in the first place. @monollonom Than you for the suggestions. The XHR response I get when uploading is 403 forbidden I am not sure if I use or not ImageSizerEngineImagick. I guess I don’t, but how can I be sure? toggling to Overwrite existing files ON doesn’t solve the issue. Thank you for taking time to help me. Edited October 13 by rooofl
monollonom Posted October 14 Posted October 14 On 10/13/2025 at 8:10 AM, rooofl said: I am not sure if I use or not ImageSizerEngineImagick. I guess I don’t, but how can I be sure? In the “Core” tabs of the “Modules” page, look for the “IMagick Image Sizer” module and check if it’s installed. Is so, try uninstalling it and see if it solves your issue.
BrendonKoz Posted Tuesday at 07:42 PM Posted Tuesday at 07:42 PM Hey @rooofl, I saw your request for help. I unfortunately don't do client work, but would still like to offer at least one additional chance for fixing this issue. It doesn't seem like this client is a Dreamhost customer, but it's entirely possible that the host may have similar configurations for security on their server. You may want to reach out to, or have the client reach out to, the webhost support team and ask if the URL as provided in the network devtools that you screenshotted would cause their server security to prevent the request. For Dreamhost, the solution was simply to change the custom URL for the administrative panel from whatever custom option (ex: "admin" in your screenshot's case) back to the default of "processwire". This is due to their custom mod_security rules. They can update their rules for one-off requests, but the next time they update the server software it'll break again. Here's where I mention it: It's worth a shot to, at least, try changing the admin panel URL from "admin" to "processwire" and then testing an upload to see if it fixes things. Otherwise a support ticket to the webhost would be my next suggestion. 2
rooofl Posted yesterday at 08:46 AM Author Posted yesterday at 08:46 AM Thank you for this last tip @BrendonKoz, unfortunately, changing the admin URL didn’t solve that neither. 1
rooofl Posted yesterday at 08:54 AM Author Posted yesterday at 08:54 AM Solved! As @matjazp advised in PM, mod_security was the problem. I contacted my host provider (OVH) and changed in .ovhconfig the line: http.firewall=security to http.firewall=none Thank you all for your time. 4
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now