我正在使用黑莓webworks我想上传图像从相机到php webserver我在uri中获取图像,它显示正确,但我不知道如何将图像上传到服务器请帮忙。从黑莓WebWorks SDK相机到PHP文件服务器的帖子图像
文件URI 文件://目录/图片名称
我使用黑莓WebWorks的摄像头API这段代码
function takePicture() {
try {
blackberry.media.camera.takePicture(photoTaken, closedCB, errorCB);
} catch (e) {
//alert("Error in supported: " + e);
}
}
function successCB(filePath) {
var file = "file://" + filePath;
$("#myfileCam").val(file);
$("#imgPic").show();
$("#imgPic").attr("src", file);
}
function photoTaken(filePath) {
var img = new Image();
img.src = "file://" + filePath;
img.width = Math.round(screen.width/2);
document.getElementById("path").appendChild(img);
var html = "<input type='file' name='myfile' id='myfile' value='file://" + filepath + "' />";
document.getElementById("fileup").innerHTML = html;
//$("#fileup").html();
$("#myfileCam").val("file://" + filePath);
}
function closedCB() {
// alert("Camera closed event");
}
function errorCB(e) {
alert("Error occured: " + e);
}
从图像中获取图像数据并将数据发送到服务器。 – Signare 2012-03-13 08:39:29
你有什么特别的例子吗?谢谢 – 2012-03-13 12:01:06