我正在使用黑莓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