お世話になります。
Monacaで、撮影した写真をサーバーにアップロードしようとしています。
FileTransferで実施しようとしているのですが、fileKeyがサーバーで受信した際に「undefined」と
なっていて定義されない状態です。
端末側処理
function uploadImage( fileKey, url, fileUrl, params ){
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = "kuma_img.jpg";
options.mimeType = "text/plain";
options.chunkedMode = false;
options.params = params;
var ft = new FileTransfer(); ft.upload(fileUrl, encodeURI(url), onUpSuccess, onUpError, options);
}
options.fileKeyはデフォルトが"file"なので指定しないのも試したのですが、やはり"undefined"と
なりました。
サーバー側処理(PHP):抜粋
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
ここで"PHP Notice: Undefined index: file in〜"となってしまいます。
対策をご存じの方ご教授ください。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。