{"success":true} however, fineuploader displays an error

{"success":true} is returned by the php server script, indicating successful file upload but fineuploader displays an error message in red on the webpage. Upon checking the console, the following error was found:

fineuploader-3.2.min.js:

[FineUploader] Error when attempting to parse xhr response text (SyntaxError: Unexpected token < in JSON at position 1)

Similar issue can be seen here

 <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message:  Undefined property: stdClass::$relation_value</p>
<p>Filename: libraries/Image_crud.php</p>
<p>Line Number: 527</p>


    <p>Backtrace:</p>
    <p style="margin-left:10px">
            File: /storage/ssd2/410/2722410/public_html/application/libraries/Image_crud.php<br />
            Line: 527<br />
            Function: _error_handler            </p>

            <p style="margin-left:10px">
            File: /storage/ssd2/410/2722410/public_html/application/controllers/<-COntroller name->.php<br />
            Line: 56<br />
            Function: render            </p>
    
        
            <p style="margin-left:10px">
            File: /storage/ssd2/410/2722410/public_html/index.php<br />
            Line: 315<br />
            Function: require_once          </p>
</div>{"success":true}

P:S It is working fine in my local (Windows 10) chrome ,FF on wamp server but when i uploaded in free hosting service i got the above error while uploading

Answer №1

The PHP server script is returning a response with the key "success" set to true

Actually, it's not.

Instead of just returning JSON data, your server is sending back a mix of HTML (seemingly an error message) and some JSON content. This could be causing confusion for JavaScript as it doesn't know how to handle this combination. To resolve this issue, you should ensure that only valid JSON responses are returned from your server.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Adjust the panel size accordingly for smaller screens

My application is utilizing the Spotify API to retrieve names and images. These are then displayed on my webpage within cards/panels in the following format: <div class="col-md-4" v-if="type == 'tracks'" v-for="(track, index) in tracks"> ...

Why do I need to control-click in order to download the link?

Lately, I have been operating a simple node.js server for hosting a website. However, recently, I encountered an issue where one of my download links began redirecting to the index.html page instead of initiating the download process for the PDF it is supp ...

How can I unselect a radio button by double clicking on it?

I am in need of a specific feature: When a user clicks on a radio button that is already checked, I want it to become unchecked. I've attempted to implement this code but unfortunately, it has not been successful. $(document).on('mouseup' ...

What is the best method for utilizing an autocomplete plugin to update a div element?

I am seeking assistance regarding implementing an autocomplete feature in a DIV that displays the names, images and ages of other users as they are typed into a field positioned above the DIV. I want this autocomplete functionality to mimic Facebook' ...

Issue: The value of an object is not defined (evaluating '$scope.inputcode.password')

HTML Form: <form ng-submit="mylogin()"> <div class="list"> <label class="item item-input"> <span class="input-label">Username</span> <input type="text" ng-model="inputcode.username"> ...

The selected attribute does not function properly with the <option> tag in Angular

Currently, I am faced with a challenge involving dropdowns and select2. My task is to edit a product, which includes selecting a category that corresponds to the product. However, when I open the modal, the selected group/category is not displayed in the d ...

Can an iFrame be programmed to automatically scroll?

Here's an example of autoscroll: I am looking to implement autoscroll for the content within an iframe that has a width wider than the browser window. Can this be achieved using jQuery? ...

Struggling to use GSAP to control the timeline with my custom functions

I'm attempting to create a greensock animated banner with the ability to switch between different scenes. I've made progress by setting up the timeline for each scene's intro and outro animations using the GreenSock API documentation. Howeve ...

Adjust the width of the dropdown menu to match the text input field using jQuery

Struggling with jquery-mobile to collect user information, I am facing an issue aligning the width of my select menu with the text input fields. Despite successfully matching the background and border colors of the select menu with the text input fields, ...

Determine the height of the left div, which is set to auto, and apply the same height to the right div, which has overflow set

I am facing an issue that needs a solution. I need to ensure that two div elements have the same height. The left div should have 'auto' height while the right one must match it. Moreover, the right div contains 14 nested divs that need to be scr ...

My JavaScript code is being executed before Chrome Auto-fill

I have successfully created form input elements in Chrome that display a floating label when focused. However, I am encountering an issue when the browser autofills the username and password fields with yellow prefilled text. The JavaScript for the float ...

Is it necessary to include the 'html' and 'body' tags in a WordPress Page Template?

Currently, I'm in the process of creating a unique Page Template for my WordPress website. In the file named newpagetemplate.php, I have included only this code: <html> <body> <?php /* Template Name: CustomPage */ ?> <div> ...

Using jQuery to Populate a Table with JSON Data

Despite my extensive search and analysis of similar questions on this forum, I have reached a roadblock. My script is failing to load data from a Json file into the table I am trying to create, even after closely following the jquery API guidelines. Any as ...

Analyze the HTML data received from the API

When accessing the api, I use the following code: $.ajax({ contentType: "text/html; charset=utf-8", dataType: "jsonp", type: "get", crossDomain: true, url: "http://data.nba.com/data/10s/html/nbacom/2013/gameinfo/20140501/0041300106_ ...

How should HTML5 type "month" be stored in a Django model's database using which data type?

My HTML form includes a field for inputting a month <input type='month' name="last_appraisal" id='txtLastAppraisal' value='2013-12' /> In the Django model, I have defined this field as last_appraisal = models.DateFie ...

What is the process for encoding images in HTML code?

Is there a method to embed a background image directly in the HTML code? For instance: background-image: url(data:image/gif;base64,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX); If I have an image file, can I encode its data and t ...

I'm not sure why, but for some strange reason, Markdown images refuse to display when surrounded by

Recently, I've encountered a strange issue where my markdown image tag doesn't display the image when wrapped in a <div> or a <section>. Instead, it just outputs markdown code. Take a look at this screenshot for reference. <sectio ...

Using ReactJS to strip HTML tags from JSON response

I'm having trouble figuring out how to strip HTML tags from a JSON response in reactjs. Here's the JSON response: { "price": "26,800.98", "diff": "<!--daily_changing-->+13.44 (+0.05%)&nbsp;& ...

Making changes to a value in Laravel through an API request

I've been attempting to modify the handicap score through a post request, but I keep receiving an error message which says: creating default object from empty value. Here is the code snippet: public function handicap(Request $request) { ...

Jumping Sticky Table Headers

Looking for a solution to prevent the table header from moving when scrolling through the data: tbody { overflow-y: scroll; } thead, tbody tr { display: table; width: 100%; table-layout: fixed; text-align: left; } thead, th { position: sti ...