Hi,
I currently have an element for input type file on my app for uploading files via the file browser.
<input type="file" class="upload" id="file-upload-{{line.line_id}}" onchange="angular.element(this).scope().onFileSelect(angular.element(this).scope().$index);"/>
on the onFileSelect
function, I access it via:
var element_name = "file-upload-" + $scope.lines[index].line_id;
var element = document.getElementById(element_name);
var files = element.files;
However, no matter what the type of file I upload, it seems to take it in as a Blob
. Even the filename is “Blob” even though it has the mime type. I recently upgraded from UIWebView to WKWebView so i’m not sure if that’s the issue but I can’t seem to find anything on it. It worked before on UIWebView and it also currently works on Android. On Android, it takes it in as whatever file it is.
Is there something I’m missing here? Do I need to convert it to file specifically for iOS? I take this file and upload it to my backend (PHP) via http.post
.
Edit:
Just to reiterate, this worked previously on UIWebView. Has something changed on WkWebView where this no longer works or if it needs to be done a different way?