File upload field returns error “Failed to load resource:

  • Posts: 620
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
3 days 2 hours ago #369195

-- HikaShop version -- : 6.1.0
-- Joomla version -- : 5.4.0
-- PHP version -- : 8.3

Hi HikaShop team,

I created a custom field of type Item with File upload enabled.
The file upload itself works correctly on the website, but the field is shown in red after uploading.
But when I look at /media/com_hikashop/upload/safe all the files are there.

When I check in the browser console, I see the following error:

Failed to load resource: the server responded with a status of 500 ()
hikashop.js?v=610:200 failed parsing JSON in string below:
hikashop.js?v=610:201 {closure}


I have already tested the following to rule out conflicts:
Using the default HikaShop layout (no overrides)
Restoring the root .htaccess file to Joomla’s default
Testing without any custom scripts or CSS

Do you have any idea where I should look to solve this issue?

Best regards,
Lumiga




Kind regards,
Lumiga
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 84623
  • Thank you received: 13759
  • MODERATOR
2 days 8 hours ago #369198

Hi,

The upload process takes several steps :
- the file is received by the server
1- Joomla is loaded
2- HikaShop is loaded
3- HikaShop is called for the processing
4- HikaShop copies the uploaded file from the PHP temporary folder to its upload folder
5- HikaShop generates data to be sent back to the browser
6- HikaShop formats the data via a view file

If you get a 500 error with the upload, it means that there is likely a PHP error during all that processing. And if you have the file in the upload folder, it means that it happens after step 4.

Still, without the real error message behind the generic 500 error, it will be hard to say what the problem is.
I would recommend activating the "debug" setting of the Joomla configuration and trying again.
Then, in the developer tools of your browser, look at the HTTP request with the 500 status code and check its response from the server. It should hopefully contain the error message along with the call stack etc.
If that's not the case, it could be your template hiding the details with a custom templates/YOUR_TEMPLATE/error.php file. So renaming that file temporarily via FTP could help to get the details.
Or it could also be your web server configured to not provide the details. In that case, you'll have to check the PHP error log or the web server error log for more details on the issue.

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum