ok, so I've got it working by modifying the FileUploadHelper function UploadPhoto.
code
if (imageURI.indexOf("?")>0) {
//
// here is photo is from library - decode filename and file extension
//
var imageType = imageURI.substring(imageURI.lastIndexOf('.'),imageURI.lastIndexOf('?'));
var imageName = imageURI.substring(imageURI.lastIndexOf('?')+1);
} else {
//
// here if file from camera
//
var imageType = imageURI.substring(imageURI.lastIndexOf('.'));
var imageName = imageURI.substring(imageURI.lastIndexOf('/')+1,imageURI.lastIndexOf('.'));
}
// var imageType = imageType1.substr(imageURI.lastIndexOf('.')+1);
var options = $.extend(new FileUploadOptions(), reqOptions);
Code: Select all
if(imageName) {
options.fileName = imageName + imageType;
options.fileKey= imageName + imageType;
} else {
options.fileName = imageURI.substr(imageURI.lastIndexOf('/')+1);
options.fileKey = imageURI.substr(imageURI.lastIndexOf('/')+1);
}
/code
Basically, I've pulled out the correct filename from the string reported by the URI depending on whether the image is from the camera or a gallery photo.
Maybe this is only happening on Android Marshmallow? I'm testing on a Nexus 6P currently.