Ho riscontrato un problema nel tentativo di caricare un'immagine ottenuta da una foto scattata con la fotocamera, utilizzando la libreria Android Amazon S3.open failed: ENOENT (Nessun file o directory) errore
per salvare l'immagine
File _photoFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), (cal.getTimeInMillis() + ".jpg"));
try {
if (_photoFile.exists() == false) {
_photoFile.getParentFile().mkdirs();
_photoFile.createNewFile();
}
} catch (IOException e) {
// Log.e(TAG, "Could not create file.", e);
}
// Log.i(TAG, path);
filePath = Uri.fromFile(_photoFile);
Intent cameraIntent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, filePath);
startActivityForResult(cameraIntent, 1);
Per caricare l'immagine con il filePath:
try {
s3Client.createBucket(Constants.getPictureBucket());
// Content type is determined by file extension.
PutObjectRequest por = new PutObjectRequest(
Constants.getPictureBucket(), Constants.PICTURE_NAME,
new java.io.File(filePath));
s3Client.putObject(por);
} catch (Exception exception) {
result.setErrorMessage(exception.getMessage());
}
Continuo a ricevere un errore Unable to calclualte MD5 hash:/file:/storage/sdcard0/DCIM/13161272646580.jpg open failed:ENOENT (No such file or directory)
ma quando passo in rassegna la mia sd directory della scheda Posso trovare l'immagine lì (l'immagine è stata crea ted) e ho creato le autorizzazioni pertinenti.
Hai mai trovato una soluzione per questo? –
Sto affrontando lo stesso problema. Conosci la soluzione? – Sakthimuthiah
Lo stesso qui, qualsiasi soluzione? @just_user? – osayilgan