Я использую Blackberry Webworks. Я хочу загрузить изображение с камеры на php-сервер. Я получаю изображение в URI, и оно отображается правильно, но я не знаю, как загрузить изображение на сервер, пожалуйста, помогите.
file urifile: // dir / name name
Я использую этот код с камеры BlackBerry 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);
}