phonegap のfiletransfer.upload
.
これがファイルを送信するための私のコードです
sendImageFile = function (imageURI, imageName) {
writelog("Sending image file", 1);
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="image/jpeg";
var params = new Object();
params.value1 = "image name";
options.params = params;
options.chunkedMode = false;
var ft = new FileTransfer();
writelog("image uri length " + imageURI.length, 1);
writelog("Image options set up successfully", 1);
var ft = new FileTransfer();
ft.upload(imageURI, uploadurl, win, transFail, options);
}
ここにlogcatの関連行がいくつかあります
01-07 12:27:30.743: D/FileTransfer(20066): Uploaded 114688 of 145432 bytes
01-07 12:27:31.571: D/FileTransfer(20066): got response from server
01-07 12:27:31.696: D/CordovaLog(20066): Code = 200
01-07 12:27:31.696: D/CordovaLog(20066): Response = 12099
01-07 12:27:31.696: D/CordovaLog(20066): Sent = 145236
どんな助けでも大歓迎です。
ありがとう
マット