1
Photogalery에서 선택한 이미지를 보내려면 스크립트 (Android 용 Phonegap)를 만들려고하는데, 힘든 일입니다.Phonegap - Photogalery에서 서버로 이미지를 업로드하는 중 오류가 발생했습니다.
function onCapturePhoto(imageURI) {
var uri = encodeURI("https://www.myserver.com/webservices/uploadFoto.php");
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType = "text/jpeg";
var ft = new FileTransfer();
ft.upload(imageURI, uri, win, fail, options);
function win(r) {
console.log("Code: = " + r.responseCode);
console.log("Response: = " + r.response);
console.log("Sent: = " + r.bytesSent);
}
function fail(error) {
console.log("An error has occurred: Code = " + error.code);
console.log("upload error source: " + error.source);
console.log("upload error target: " + error.target);
}
}
function getPhoto() {
navigator.camera.getPicture(onCapturePhoto, onFail, {
quality: 80,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
allowEdit : true,
targetWidth: 150,
encodingType: navigator.camera.EncodingType.JPEG
});
}
function onFail(message) {
alert('Failed because: ' + message);
}
임 '다음과 같은 오류지고 :
오류가 발생했습니다 코드 = 1
업로드 오류 소스 : 파일 : 내 스크립트에 따라
/// 저장/에뮬레이션 /0/Android/data/mobi.monaca.debugger/cache/.Pic.jpg
업로드 오류 대상 : https://www.myserver.com/webservices/uploadFoto.php
Monaca Debugger를 사용하고 있습니다. 이미지를 업로드
고마워 님의
변경을! !!! 지금 일하고있어! : D : D : D : D –