Question

I am using Fine uploader to upload images. I include javascript from GitHub. I include:

  • jquery-1.8.3.min.js
  • util.js
  • button.js
  • handler.base.js
  • handler.form.js
  • handler.xhr.js
  • uploader.basic.js
  • dnd.js

I want to use it as Fine Uploader Basic (FUB) because it's easy customize.

Below is my server code in PHP just return json:

$result = array("success"=>true, "id"=>"001", "name"=>"dararath");
header("Content-Type: text/plain");
echo json_encode($result);

It work fine in Chrome, Firefox and IE 9 but IE 8 and 7 show save dialog instead of json.

  • Does my include of javascript correct?
  • Does my php json error or have any code in Fine Uploader to correct this behavior, because in it's example test on IE 7 and IE 8 work fine?

Update (2016-07-21)

I need to change header to solve the problem.

$result = array("success"=>true, "id"=>"001", "name"=>"dararath");
header("Content-Type: application/json");
echo json_encode($result);
Was it helpful?

Solution

First, I suggest you download the combined version of the js. See the downloads section on the home page.

Second, your problem has been covered many times in the forums and in the issue tracker. I will go ahead and add an entry to the FAQ now as well.

Solution: Your response MUST have a content-type of "text/plain". If you are seeing the "Save As" dialog, your response's content-type is likely "application/json". Inspect the response carefully to verify.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top