Home >Backend Development >PHP Tutorial >ajax提交base64图片编码,php服务器端接收不到

ajax提交base64图片编码,php服务器端接收不到

WBOY
WBOYOriginal
2016-06-20 12:27:381529browse

$.ajax({
                        url: $("#hdImage").attr("value"),
                        type: "POST",
                        dataType:'text',
                        data: {"imagedata": rst.base64},
                        success: function(result) {
                        }
                    });


php接收:
$base64_string = $_POST['imagedata'];     获取到的值为null

但是如果在js端把data: {"imagedata": rst.base64}修改为data: {"imagedata": 1234},php端是能接收到数据的,请问这个是什么情况,谢谢!


回复讨论(解决方案)

rst.base64 没有值

rst.base64 没有值



这个有值的,我用firefox调试的时候,有很多值传过去了

找到原因了,其实值是获取到了,只不过我通过xdebug+phpstom调试时候,phpstorm超过一定长度的变量,监控就不起作用

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn