简体   繁体   中英

Ajax post works in chrome but no data recieved on server with ie and firefox

I need to retrieve and process a image (png) generated by a flash application. When a user clicks a link I :

var dataImgBase64 = document.getElementById("flashApp").getThumbnail();

So the flash app sends me a image in base64. Then I:

var params = 'b=' + encodeURIComponent(dataImgBase64);

$.ajax({
    type: "POST",
    url: "arrival.php",
    data: params,
    success: function (msg) {
        $("#ppp").html(msg);
    }
});                   

heres is arrival.php:

$data = $_POST['b'];

    echo strlen($data);

In chrome I get the expected size of around 900k but in ie and firefox I get 0. I checked with firebug and I do send the post data but it cuts in the middle with a message that firebug as reached its post size limit. Is it possible to do what I want the way I want? If not what else could I do? I tried playing around with some settings like:

processDataBoolean: false,
contentType: "application/x-www-form-urlencoded",

Nothing worked. editL the server is a shared hosting account on linux.

Since no one can help me I helped myself! After testing I found out I can send in a single ajax request 1000000 '1's but it will fail on all browsers for 1000001 '1's. I have a hard time finding information because everywhere I look on the net its talks about a file upload dialog (and I got my data from a flash pluguin on the webpage very different context.

So as of now my solution is to split the data and send it thru many ajax connections.

I'll leave the question open in case someone passes by and has a better answer.

Why do you do it with ajax? Can't you just insert the specfied path in the src attribute in a img tag?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM