我正在从用户的图库中检索图像,并尝试使用php和mysql将base64编码的版本发布到服务器上。返回的base64字符串为:
/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAPAAhwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDsRgU4DIpi5FOBrZnOhwUClxxSDkU8UhkLLUTKQfrVlhTCAecU0xNEBUYppT0NTFcim7TirTE0QkEGlANPK+1AXFVcVhuCD9aeB0IpwFBGORU3HYUA0o4pAec05aljQBjijINKAKQildAKppQKRVJp2MCgEGBTWxTs5oIyKSYyJlzmo9pHGeKnK0m2rTE0QZINOV8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xWMpAuXLhc8HJ5x34rSmtSamxnzECQAAgdeetDMQCBnkg4pZ3VrvJPygnBPfNV2lAckk4/lWrRkmPFwVOD8wAwQagmj80b4xuBzgHg8dh602Vh55AOQTjIoVWy0ZJznIweQfUUJWBu5SMpB54XoQOmP8AEU5nKSAg5wM59RSuFlOxwElzw3Yn0NRMSYxG64lQ9e5HpWuhmxVYGQN2J5q/vLQxLnjBPH1rKJxyBwasxyYUEdhihrQExZGDx4I+bAOfcUSfMEccMAB/9eopDiQ46Z4pNxYEe1ILk7OWAJ+8CDk0vmkXAccHA5qJWyAecjqKMc5HTpTsCZNMd0gYdxipY1yQcdqZGuVxjtxVhFKgYGSTgCpZSRPCC7BQOBjH1rQ8ramAeBUNoB5uMYxxk1obd4z0HX61DZaRHBDlTxnA5q/aW4AAA+pPc0trAWAGOD3rStoCDz0PSpbLSJbeDjkdavRxBQAO1RRYxgdqnU0ITHgYI96fTc0oPPSmZsetLk00EAUZBpktDs46mlyPWoyc0uaLhYloooqyQooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACkxkYNLiigCBzsUL2JwP/AK9YuqAKowMHJNbkgBxkZ5rE1yMxQ7uoINKWw46M5+VgoMhOQAQB6msWZ5JSEJAycDjkZrQmfEaqex4x79apYDXAGMYOSfUVCRsPtCRO2QML8q+59a27LIhyepOaxVISfA5wCT9TxW3ageWC
用于发布的代码(base64字符串为cameraPic):
$.post("https://www.domaintopostto.co.uk/API/users.php", { user: usernamePost, userID: result.id, gender: gender, image: cameraPic }, function (data) {
console.log(data);
console.log("HERE");
if (data.result = "Added") {
window.location = "sportsSelector.html";
}
});
服务器上的PHP代码:
$image = $_POST['image'];
$base64img = str_replace('data:image/jpeg;base64,', '', $image);
$sql = "INSERT INTO userActivityLocation(user, userID, gender, image)VALUES('$user', '$userID', '$gender', '$base64img')";
base64字符串没有出现在数据库中。事实上,请求的image: cameraPic
pasrt完全消失了。。。。。它不在chrome的网络视图中。其他领域的火力良好,并显示在铬。控制台中没有错误,服务器也没有响应。
任何建议都将不胜感激,谢谢!
我试图复制你的脚本,这对我来说很有效:
var cameraPic = "yourverylongencodedstring";
$.post("query.php", { image: cameraPic }, function (data) {
console.log(data);
});
在query.php上我有:
<?php
$image = $_POST['image'];
$base64img = str_replace('data:image/jpeg;base64,', '', $image);
echo $base64img;
?>
我可以在chrome中的网络面板中看到正确的响应字符串;
所以我想知道:
-你路过一个空相机Pic var?
-如果它没有在sql查询后显示,那么sql字段是否足够大以容纳字符串?
-您没有将"www.domaintopostto.co.uk"列入白名单?
试着猜测!