우선 적어논 파일 디렉토리는
File fileToUpload = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "Camera/pleaseee.jpg");
File fileToDownload = new File("");
AmazonS3 s3;
TransferUtility transferUtility;
이런 식이고
파일 주소를 테스트 겸 일부로 틀리게 적었을 경우
02-28 20:30:08.451 16381-17624/app.s3amazon E/UploadTask: Failed to upload: 217 due to Unable to calculate MD5 hash: /storage/emulated/0/DCIM/Camera/pleaseee.jpg: open failed: ENOENT (No such file or directory)
라는 에러가 생기고
앱이 종료되며
다시 파일 경로를 정정해서 제대로 적으면
02-28 20:28:52.331 21752-15679/app.s3amazon E/UploadPartTask: Encountered error uploading part The specified file doesn't exist
라는 에러가 생깁니다.
앱은 종료되지 않으며 S3에 사진만 업로드 되지 않습니다.
두번째 에러도 결국 파일을 찾을 수 없다는 건가요?
업로드 부분 코드입니다.
public void setFileToUpload(View view){
TransferObserver transferObserver = transferUtility.upload("sangmin", "please.jpg", fileToUpload);
transferObserverListener(transferObserver);
}