diff --git a/src/core/fileuploader/providers/helper.ts b/src/core/fileuploader/providers/helper.ts index 168fee217..fc0c6abf8 100644 --- a/src/core/fileuploader/providers/helper.ts +++ b/src/core/fileuploader/providers/helper.ts @@ -458,14 +458,19 @@ export class CoreFileUploaderHelperProvider { // The mimetypes param is only for desktop apps, the Cordova plugin doesn't support it. return promise.then((medias) => { // We used limit 1, we only want 1 media. - const media: MediaFile = medias[0], - path = media.fullPath, - error = this.fileUploaderProvider.isInvalidMimetype(mimetypes, path); // Verify that the mimetype is supported. + const media: MediaFile = medias[0]; + let path = media.fullPath; + const error = this.fileUploaderProvider.isInvalidMimetype(mimetypes, path); // Verify that the mimetype is supported. if (error) { return Promise.reject(error); } + // Make sure the path has the protocol. In iOS it doesn't. + if (path.indexOf('file://') == -1) { + path = 'file://' + path; + } + if (upload) { return this.uploadFile(path, maxSize, true, this.fileUploaderProvider.getMediaUploadOptions(media)); } else {