@@ -79,7 +79,6 @@ export class AttachmentService {
7979 {
8080 text : this . texts [ "FRMELEMNTS_MSG_USE_FILE" ] ,
8181 handler : ( ) => {
82- console . log ( path , "oath" ) ;
8382 path ? this . openLocalLibrary ( ) : this . openFile ( ) ;
8483 return false ;
8584 } ,
@@ -115,7 +114,7 @@ export class AttachmentService {
115114 text : this . texts [ "FRMELEMENTS_LBL_UPLOAD_IMAGE" ] ,
116115 icon : "cloud-upload" ,
117116 handler : ( ) => {
118- this . openLocalLibrary ( )
117+ this . takePicture ( this . camera . PictureSourceType . PHOTOLIBRARY , this . camera . MediaType . PICTURE ) ;
119118 return false ;
120119 } ,
121120 } ,
@@ -160,7 +159,7 @@ export class AttachmentService {
160159 . then ( ( imagePath ) => {
161160 if ( this . platform . is ( "android" ) && sourceType === this . camera . PictureSourceType . PHOTOLIBRARY ) {
162161 let newFilePath = imagePath ;
163- if ( ! newFilePath . includes ( "file://" ) ) {
162+ if ( ! newFilePath . includes ( "content://" ) && ! newFilePath . includes ( " file://") ) {
164163 newFilePath = "file://" + imagePath
165164 }
166165 this . checkForFileSizeRestriction ( newFilePath ) . then ( isValidFile => {
@@ -221,7 +220,8 @@ export class AttachmentService {
221220
222221 checkForFileSizeRestriction ( filePath ) : Promise < Boolean > {
223222 return new Promise ( ( resolve , reject ) => {
224- this . file . resolveLocalFilesystemUrl ( filePath ) . then ( success => {
223+ this . filePath . resolveNativePath ( filePath ) . then ( fileData => {
224+ this . file . resolveLocalFilesystemUrl ( fileData ) . then ( success => {
225225 success . getMetadata ( ( metadata ) => {
226226 if ( metadata . size > localStorageConstants . FILE_LIMIT ) {
227227 this . presentToast ( this . texts [ "FRMELEMNTS_LBL_FILE_SIZE_EXCEEDED" ] , 'danger' , 5000 ) ;
@@ -233,6 +233,9 @@ export class AttachmentService {
233233 } ) . catch ( error => {
234234 reject ( false )
235235 } )
236+ } ) . catch ( error => {
237+ reject ( false )
238+ } )
236239 } )
237240 }
238241
0 commit comments