2016-08-22 4 views
0

갤러리에서 이미지를 가져오고 Sqlite에 이미지 이름을 저장했습니다.이미지가 삭제 된 양식 tmp 폴더가 닫힌 경우

var options = {quality: 75, 
       destinationType : Camera.DestinationType.FILE_URI, 
      sourceType: Camera.PictureSourceType.PHOTOLIBRARY, 
      allowEdit: true, 
      encodingType: Camera.EncodingType.JPEG, 
      targetWidth: 300, 
      targetHeight: 300, 
      popoverOptions: CameraPopoverOptions, 
      saveToPhotoAlbum: true 
      }; 
$cordovaCamera.getPicture(options).then(function (imageData) { 
$scope.ChooseImage = imageData; 
} 

이미지 이름을 Sqlite에 저장 한 후 페이지를 다시로드 한 다음 Sqlite에서 이미지 이름을 가져옵니다. 그것은 잘 작동하고

var imageGetting = "select * from images_details where taskId='"+$scope.unquid+"'"; 
      $cordovaSQLite.execute(db, imageGetting).then(function(data) { 
                  var GetAllImages = data.rows.length; 
                  for(i=0;i<GetAllImages;i++){ 
                  debugger; 
                  $scope.images.push(cordova.file.tempDirectory + data.rows.item(i).imageUrl); 
                  debugger; 
                  } 
} 

하지만 우리는 응용 프로그램을 닫을 때 TMP 폴더 데이터는 사라질 것입니다, 그래서 우리는 이미지를 표시 할 수 없습니다 : 우리는 cordova.file.tempDirectory에 추가 할 수 있습니다. tmpfile이 삭제 된 경우에도 이미지를 보여줄 수있는 대안이 있습니까?

답변

0

.에 이미지를 저장하기 위해 여러 가지 다른 영구/임시 디렉토리가있는 파일 플러그인은 잘 설명하고 당신이 그것을 통해 당신의 방법을 확인해야합니다.

File Plugin: Where to store

file system layouts이 문서에서 설명된다.