开发者

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

开发者 https://www.devze.com 2023-04-06 16:03 出处:网络
I need to retrieve and process a image (png) generated by a flash application. When a user clicks a link I :

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 messag开发者_开发技巧e 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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消